-
Notifications
You must be signed in to change notification settings - Fork 34
/
setup.py
71 lines (59 loc) · 2.18 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
#!/usr/bin/env python
import os
import setuptools.command.build_py
import setuptools.command.develop
from setuptools import find_packages, setup
cwd = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(cwd, "VERSION")) as fin:
version = fin.read().strip()
class build_py(setuptools.command.build_py.build_py): # pylint: disable=too-many-ancestors
def run(self):
self.create_version_file()
setuptools.command.build_py.build_py.run(self)
@staticmethod
def create_version_file():
print("-- Building version " + version)
version_path = os.path.join(cwd, "version.py")
with open(version_path, "w") as f:
f.write("__version__ = '{}'\n".format(version))
class develop(setuptools.command.develop.develop):
def run(self):
build_py.create_version_file()
setuptools.command.develop.develop.run(self)
requirements = open(os.path.join(cwd, "requirements.txt"), "r").readlines()
with open("README.md", "r", encoding="utf-8") as readme_file:
README = readme_file.read()
setup(
name="coqpit",
version=version,
url="https://github.com/erogol/coqpit",
author="Eren Gölge",
author_email="[email protected]",
description="Simple (maybe too simple), light-weight config management through python data-classes.",
long_description=README,
long_description_content_type="text/markdown",
license="",
include_package_data=True,
packages=find_packages(include=["coqpit*"]),
project_urls={
"Tracker": "https://github.com/coqui-ai/coqpit/issues",
"Repository": "https://github.com/coqui-ai/coqpit",
"Discussions": "https://github.com/coqui-ai/coqpit/discussions",
},
cmdclass={
"build_py": build_py,
"develop": develop,
},
install_requires=requirements,
python_requires=">=3.7.0",
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
],
zip_safe=False,
)