-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
58 lines (47 loc) · 1.58 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
import sys
from distutils.version import StrictVersion
from setuptools import find_packages, setup
PY_VER = StrictVersion(f"{sys.version_info.major}.{sys.version_info.minor}")
def get_version_and_cmdclass(package_path):
"""Load version.py module without importing the whole package.
Template code from miniver
"""
import os
from importlib.util import module_from_spec, spec_from_file_location
spec = spec_from_file_location("version", os.path.join(package_path, "_version.py"))
module = module_from_spec(spec)
spec.loader.exec_module(module)
return module.__version__, module.cmdclass
with open("README.md", "r") as fh:
long_description = fh.read()
# Require dataclasses backport if Python <= 3.6
install_requires = []
if PY_VER <= StrictVersion("3.6"):
install_requires.append("dataclasses")
version, cmdclass = get_version_and_cmdclass("shogun")
setup(
name="shogun",
version=version,
cmdclass=cmdclass,
description="Opinionated Typed Configuration",
long_description=long_description,
author="The Menpo Team",
author_email="[email protected]",
url="https://github.com/menpo/shogun",
packages=find_packages(),
install_requires=install_requires,
tests_require=[
"attrs>=20",
"pytest>=5.0",
"pytest-mock>=1.0",
"pytest-black>=0.3",
"pytest-cov>=2.0",
"black>=20.0",
],
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
],
python_requires=">=3.6",
)