-
Notifications
You must be signed in to change notification settings - Fork 35
/
setup.py
100 lines (83 loc) · 2.92 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
from setuptools import find_packages, setup
NAME = "popmon"
MAJOR = 0
REVISION = 4
PATCH = 0
DEV = False
# NOTE: also update version at: README.rst
with open("requirements.txt") as f:
REQUIREMENTS = f.read().splitlines()
# read the contents of abstract file
with open("README.rst", encoding="utf-8") as f:
long_description = f.read()
VERSION = "{major}.{revision}.{patch}".format(
major=MAJOR, revision=REVISION, patch=PATCH
)
FULL_VERSION = VERSION
if DEV:
FULL_VERSION += ".dev"
with open("requirements-test.txt") as f:
REQUIREMENTS += f.read().splitlines()
def write_version_py(filename: str = "popmon/version.py") -> None:
"""Write package version to version.py.
This will ensure that the version in version.py is in sync with us.
:param filename: The version.py to write too.
:type filename: str
"""
# Do not modify the indentation of version_str!
version_str = """\"\"\"THIS FILE IS AUTO-GENERATED BY SETUP.PY.\"\"\"
name = \"{name!s}\"
version = \"{version!s}\"
full_version = \"{full_version!s}\"
release = {is_release!s}
"""
with open(filename, "w") as version_file:
version_file.write(
version_str.format(
name=NAME.lower(),
version=VERSION,
full_version=FULL_VERSION,
is_release=not DEV,
)
)
def setup_package() -> None:
"""The main setup method.
It is responsible for setting up and installing the package.
"""
write_version_py()
setup(
name=NAME,
version=VERSION,
url="https://github.com/ing-bank/popmon",
license="MIT",
author="ING Wholesale Banking Advanced Analytics",
description="Monitor the stability of a pandas or spark dataset",
keywords="pandas spark data-science data-analysis monitoring statistics python jupyter ipython",
long_description=long_description,
long_description_content_type="text/x-rst",
python_requires=">=3.6",
packages=find_packages(),
install_requires=REQUIREMENTS,
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
# files to be shipped with the installation, under: popmon/popmon/
# after installation, these can be found with the functions in resources.py
package_data={
"popmon": [
"visualization/templates/*.html",
"visualization/templates/assets/css/*.css",
"visualization/templates/assets/js/*.js",
"test_data/*.csv.gz",
"test_data/*.json*",
"notebooks/popmon*tutorial*.ipynb",
]
},
entry_points={
"console_scripts": ["popmon_run = popmon.pipeline.amazing_pipeline:run"]
},
)
if __name__ == "__main__":
setup_package()