forked from pylhc/generic_parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
66 lines (56 loc) · 1.99 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
import os
import pathlib
import re
from setuptools import setup, find_packages
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# Name of the module
MODULE_NAME = 'generic_parser'
# Dependencies for the module itself
DEPENDENCIES = []
# Test dependencies that should only be installed for test purposes
TEST_DEPENDENCIES = ['pytest>=5.2',
'pytest-cov>=2.6',
'hypothesis>=4.36.2',
'attrs>=19.2.0'
]
# pytest-runner to be able to run pytest via setuptools
SETUP_REQUIRES = ['pytest-runner']
# Extra dependencies for tools
EXTRA_DEPENDENCIES = {'doc': ['sphinx',
'travis-sphinx',
'sphinx_rtd_theme']
}
# The text of the README file
README = (HERE / "README.md").read_text()
def get_version():
""" Reads package version number from package's __init__.py. """
with open(os.path.join(
os.path.dirname(__file__), MODULE_NAME, '__init__.py'
)) as init:
for line in init.readlines():
res = re.match(r'^__version__ = [\'"](.*)[\'"]$', line)
if res:
return res.group(1)
# This call to setup() does all the work
setup(
name=MODULE_NAME.replace('_', '-'),
version=get_version(),
description="A parser for arguments and config-files that also allows direct python input.",
long_description=README,
long_description_content_type="text/markdown",
url="https://github.com/pylhc/generic_parser",
author="pyLHC",
author_email="pylhc@github.com",
license="MIT",
classifiers=[
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
],
packages=find_packages(include=('generic_parser',)),
install_requires=DEPENDENCIES,
tests_require=DEPENDENCIES + TEST_DEPENDENCIES,
extras_require=EXTRA_DEPENDENCIES,
setup_requires=SETUP_REQUIRES
)