-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
68 lines (56 loc) · 1.94 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
"""A setuptools based module setup."""
import os
import setuptools
NAME = "pycnfg"
DESCRIPTION = "Pycnfg. Flexible Python configurations."
URL = "https://github.com/nizaevka/pycnfg"
REQUIRES_PYTHON = ">=3.6"
PATH = os.path.abspath(os.path.dirname(__file__))
# Get text.
def parse_text(filename, splitlines=False):
with open(os.path.join(PATH, filename), "r", encoding='utf-8') as f:
if splitlines:
return f.read().splitlines()
else:
return f.read()
# Get version.
version = {}
with open("src/{}/__version__.py".format(NAME)) as fp:
exec(fp.read(), version)
# Prevent install dependencies for readthedoc build
# (there is no way to set --no-deps in pip install).
on_rtd = os.environ.get('READTHEDOCS') == 'True'
if on_rtd and False:
INSTALL_REQUIRES = []
else:
INSTALL_REQUIRES = parse_text('requirements.txt', splitlines=True)
setuptools.setup(
name=NAME,
version=version['__version__'],
author="nizaevka",
author_email="[email protected]",
description="Flexible Python configurations.",
keywords='configuration',
long_description=parse_text('README.md', splitlines=False),
long_description_content_type="text/markdown",
url=URL,
package_dir={'': 'src'},
packages=setuptools.find_packages(where='src'),
install_requires=INSTALL_REQUIRES,
# $ pip install package[dev]
extras_require={
'dev': parse_text('requirements_dev.txt', splitlines=True),
},
classifiers=[
"Development Status :: 4 - Beta", # https://pypi.org/classifiers/
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
],
python_requires=REQUIRES_PYTHON,
project_urls={
'Documentation': 'https://pycnfg.readthedocs.io/',
'Source': "https://github.com/nizaevka/pycnfg",
'Tracker': "https://github.com/nizaevka/pycnfg/issues",
},
)