-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.py
78 lines (59 loc) · 1.88 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
"""Packaging and distribution configuration."""
import os
import warnings
import setuptools
VERSION_FILE = "./VERSION"
def get_readme():
with open("README.md", "r") as fh:
return fh.read()
def get_version():
"""Reads the current version from two potential sources.
It does so in this order:
- environment variable `BUILD_VERSION`
- ./VERSION file
If neither of them is set, a ValueError is raised.
Returns:
str
Raises:
ValueError: if the version cannot be determined
"""
version = os.getenv("BUILD_VERSION")
if version is not None:
return version
if os.path.exists(VERSION_FILE):
with open(VERSION_FILE, "r") as f:
return f.read().strip()
warnings.warn("Could not determine build version")
return '0.0.0dev0'
def read_requirements(file_path):
"""Reads a requirements file and returns a list of strings, each being a requirements.
Args:
file_path (str):
Returns:
List[str]
"""
with open(file_path, "r") as f:
return f.readlines()
setuptools.setup(
name="dynamicio",
version=get_version(),
author="Christos Hadjinikolis, Radu Ghitescu",
author_email="christos.hadjinikolis@gmail.com, radu.ghitescu@gmail.com",
description="Panda's wrapper for IO operations",
long_description=get_readme(),
long_description_content_type="text/markdown",
packages=setuptools.find_packages(),
license="Apache License 2.0",
classifiers=[
"Programming Language :: Python :: 3.8",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
],
python_requires=">=3.8",
install_requires=read_requirements("requirements.txt"),
package_data={"dynamicio": ["py.typed"]},
entry_points="""
[console_scripts]
dynamicio=dynamicio.cli:run
""",
)