-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.py
131 lines (103 loc) · 3.39 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
"""Project: Eskapade - A python-based package for data analysis.
Created: 2017/08/08
Description:
setup script.
Authors:
KPMG Big Data team, Amstelveen, The Netherlands
Redistribution and use in source and binary forms, with or without
modification, are permitted according to the terms listed in the file
LICENSE.
"""
import logging
from setuptools import find_packages
from setuptools import setup
NAME = 'Eskapade'
MAJOR = 1
REVISION = 0
PATCH = 0
DEV = False
# NOTE: also update version at: README.rst
VERSION = '{major}.{revision}.{patch}'.format(major=MAJOR, revision=REVISION, patch=PATCH)
FULL_VERSION = VERSION
if DEV:
FULL_VERSION += '.dev'
TEST_REQUIREMENTS = ['pytest>=3.5.0',
'pytest-pylint>=0.9.0',
]
REQUIREMENTS = [
'Eskapade-Core>=1.0.0',
'matplotlib>=2.0.2',
'numpy>=1.15.0',
'scipy>=0.19.0',
'scikit-learn>=0.20.1',
'statsmodels>=0.8.0',
'pandas>=0.20.1',
'tabulate>=0.8.2',
'sortedcontainers>=1.5.7',
'histogrammar>=1.0.9',
'names>=0.3.0',
'fastnumbers>=2.0.2',
'phik>=0.9.3',
'feather-format>=0.4.0'
]
REQUIREMENTS = REQUIREMENTS + TEST_REQUIREMENTS
CMD_CLASS = dict()
COMMAND_OPTIONS = dict()
EXCLUDE_PACKAGES = []
EXTERNAL_MODULES = []
logging.basicConfig()
logger = logging.getLogger(__file__)
def write_version_py(filename: str = 'python/eskapade/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
:return:
:rtype: None
"""
# Do not modify the indentation of version_str!
version_str = """\"\"\"THIS FILE IS AUTO-GENERATED BY ESKAPADE SETUP.PY.\"\"\"
name = '{name!s}'
version = '{version!s}'
full_version = '{full_version!s}'
release = {is_release!s}
"""
version_file = open(filename, 'w')
try:
version_file.write(version_str.format(name=NAME.lower(),
version=VERSION,
full_version=FULL_VERSION,
is_release=not DEV))
finally:
version_file.close()
def setup_package() -> None:
"""The main setup method.
It is responsible for setting up and installing the package.
:return:
:rtype: None
"""
write_version_py()
setup(name=NAME,
version=FULL_VERSION,
url='http://eskapade.kave.io',
license='',
author='KPMG N.V. The Netherlands',
author_email='[email protected]',
description='Eskapade modular analytics',
python_requires='>=3.6',
package_dir={'': 'python'},
packages=find_packages(where='python', exclude=EXCLUDE_PACKAGES),
# Setuptools requires that package data are located inside the package.
# This is a feature and not a bug, see
# http://setuptools.readthedocs.io/en/latest/setuptools.html#non-package-data-files
package_data={
NAME.lower(): ['config/*', 'templates/*', 'data/*', 'tutorials/*.sh', 'notebooks/*.ipynb']
},
install_requires=REQUIREMENTS,
tests_require=TEST_REQUIREMENTS,
ext_modules=EXTERNAL_MODULES,
cmdclass=CMD_CLASS,
command_options=COMMAND_OPTIONS
)
if __name__ == '__main__':
setup_package()