-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
104 lines (88 loc) · 2.82 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/usr/bin/env python
import codecs
import os
import re
from setuptools import find_packages
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
def fread(filename):
with codecs.open(os.path.join(here, filename), "r", encoding="utf-8") as f:
return f.read()
def meta(category, fpath="src/resconfig/__init__.py"):
package_root_file = fread(fpath)
matched = re.search(
r"^__{}__\s+=\s+['\"]([^'\"]*)['\"]".format(category), package_root_file, re.M
)
if matched:
return matched.group(1)
raise Exception("Meta info string for {} undefined".format(category))
version = meta("version")
author = meta("author")
author_email = meta("author_email")
license = meta("license")
readme = fread("README.rst")
requires = ["python-dateutil>=2.8.1"]
toml_requires = ["toml>=0.10.0"]
yaml_requires = ["PyYAML>=5.3.1"]
setup_requires = ["pytest-runner>=5.2"]
dev_requires = (
[
"black>=19.10b0",
"flake8>=3.7.9",
"isort[pyproject]>=4.3.21",
"pre-commit>=2.2.0",
"seed-isort-config>=2.1.1",
]
+ toml_requires
+ yaml_requires
)
doc_requires = ["sphinx>=3.0.1", "sphinx_autodoc_typehints>=1.10.3"]
tests_require = (
["coverage[toml]>=5.0.4", "pytest>=5.4.1", "pytest-cov>=2.8.1"]
+ toml_requires
+ yaml_requires
)
setup(
name="resconfig",
version=version,
description="A minimalistic application configuration library for Python",
long_description=readme,
long_description_content_type="text/x-rst",
author=author,
author_email=author_email,
url="https://github.com/okomestudio/resconfig",
platforms=["Linux"],
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Installation/Setup",
"Topic :: Utilities",
],
packages=find_packages("src"),
package_data={"": ["LICENSE"]},
package_dir={"": "src"},
include_package_data=True,
python_requires=">=3.6",
license=license,
scripts=[],
install_requires=requires,
setup_requires=setup_requires,
tests_require=tests_require,
extras_require={
"dev": dev_requires + tests_require,
"doc": doc_requires,
"tests": tests_require,
"toml": toml_requires,
"yaml": yaml_requires,
},
entry_points={"console_scripts": []},
)