forked from drivendataorg/cloudpathlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
65 lines (57 loc) · 2.34 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env python
"""The setup script."""
from collections import defaultdict
from setuptools import setup, find_packages
from itertools import chain
from pathlib import Path
def load_requirements(path: Path):
requirements = defaultdict(list)
with path.open("r") as fp:
reqs_type = "base"
for line in fp.readlines():
if line.startswith("## extras:"):
reqs_type = line.partition(":")[-1].strip()
if reqs_type in ("base", "all"):
raise ValueError(f"'{reqs_type}' is a reserved extras keyword.")
if line.startswith("-r"):
requirements += load_requirements(line.split(" ")[1].strip())["base"]
else:
requirement = line.strip()
if requirement and not requirement.startswith("#"):
requirements[reqs_type].append(requirement)
return requirements
requirements = load_requirements(Path(__file__).parent / "requirements.txt")
extra_reqs = {k: v for k, v in requirements.items() if k != "base"}
extra_reqs["all"] = list(chain(*extra_reqs.values()))
readme = Path("README.md").read_text(encoding="UTF-8")
setup(
author="DrivenData",
author_email="[email protected]",
python_requires=">=3.7",
classifiers=[
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
description=("pathlib-style classes for cloud storage services"),
extras_require=extra_reqs,
install_requires=requirements["base"],
long_description=readme,
long_description_content_type="text/markdown",
include_package_data=True,
name="cloudpathlib",
packages=find_packages(exclude=["tests"]),
package_data={"cloudpathlib": ["py.typed"]},
project_urls={
"Bug Tracker": "https://github.com/drivendataorg/cloudpathlib/issues",
"Documentation": "https://cloudpathlib.drivendata.org/",
"Source Code": "https://github.com/drivendataorg/cloudpathlib",
},
url="https://github.com/drivendataorg/cloudpathlib",
version="0.10.0",
)