-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
115 lines (94 loc) · 3.46 KB
/
setup.py
File metadata and controls
115 lines (94 loc) · 3.46 KB
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
# -*- coding: utf-8 -*-
# ============================================================================
# Copyright: Toyota Connected, 2020. All rights reserved.
# Authors: Zokyo Developers
# ============================================================================
from setuptools import setup
from setuptools import find_packages
import sys
# This allows us to determine the package version without needing to install
# all zokyo dependencies
import builtins
builtins.__ZOKYO_SETUP__ = True
import zokyo
REQUIREMENTS = [
'numpy>=1.17.3',
'pyyaml>=5.4',
'pandas>=1.1.5',
'scikit-learn>=0.23.2',
'opencv-python>=4.4.0',
'Pillow>=5.2.0',
'scipy>=1.5.0',
'tqdm',
'tensorflow>=2.5.0rc1',
'Sphinx',
'sphinx_rtd_theme'
]
SETUPTOOLS_COMMANDS = {
'install', 'bdist_wheel', 'sdist'
}
# are we building from install or develop? Since "install" is not in the
# SETUPTOOLS_COMMANDS, we have to check that here...
we_be_buildin = 'install' in sys.argv
if SETUPTOOLS_COMMANDS.intersection(sys.argv):
from setuptools.dist import Distribution
class BinaryDistribution(Distribution):
"""Command class to indicate binary distribution.
The goal is to avoid having to later build the C or Fortran code
on the system itself, but to build the binary dist wheels on the
CI platforms. This class helps us achieve just that.
References
----------
.. [1] How to avoid building a C library with my Python package:
http://bit.ly/2vQkW47
.. [2] https://github.com/spotify/dh-virtualenv/issues/113
"""
def is_pure(self):
"""Return False (not pure).
Since we are distributing binary (.so, .dll, .dylib) files for
different platforms we need to make sure the wheel does not build
without them! See 'Building Wheels':
http://lucumr.pocoo.org/2014/1/27/python-on-wheels/
"""
return False
def has_ext_modules(self):
"""Return True (there are external modules).
The package has external modules. Therefore, unsurprisingly,
this returns True to indicate that there are, in fact, external
modules.
"""
return True
# only import numpy (later) if we're developing
if any(cmd in sys.argv for cmd in {'develop', 'bdist_wheel'}):
we_be_buildin = True
print('Adding extra setuptools args')
extra_setuptools_args = dict(
zip_safe=False, # the package can run out of an .egg file
package_data=dict(DISTNAME=['*',
'zokyo/datasets/uatg/*']),
distclass=BinaryDistribution
)
else:
extra_setuptools_args = dict()
def do_setup():
setup(
name="zokyo",
version=zokyo.__version__,
description="Data augmentation library",
author="Zokyo contributors",
author_email=[
"srinivas.v@toyotaconnected.co.in",
"srivathsan.govindarajan@toyotaconnected.co.in",
"harshavardhan.thirupathi@toyotaconnected.co.in"
"ashok.ramadass@toyotaconnected.com"
],
url="https://github.com/toyotaconnected-India/zokyo",
license="Unlicense",
packages=find_packages(),
include_package_data=True,
install_requires=REQUIREMENTS,
python_requires=">=3.5, <4",
**extra_setuptools_args
)
if __name__ == '__main__':
do_setup()