forked from voxel51/eta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
154 lines (131 loc) · 3.99 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#!/usr/bin/env python
"""
Installs ETA.
Copyright 2017-2024, Voxel51, Inc.
voxel51.com
"""
try:
from importlib import metadata
except ImportError:
import importlib_metadata as metadata
import os
import re
from setuptools import setup, find_packages
from wheel.bdist_wheel import bdist_wheel
VERSION = "0.12.5"
class BdistWheelCustom(bdist_wheel):
def finalize_options(self):
bdist_wheel.finalize_options(self)
# Pure Python, so build a wheel for any Python version
self.universal = True
INSTALL_REQUIRES = [
"argcomplete",
"dill",
"future",
"glob2",
"importlib-metadata; python_version<'3.8'",
"jsonlines",
"numpy",
"packaging",
"Pillow>=6.2",
"py7zr",
"python-dateutil",
"pytz",
"rarfile",
"requests",
"retrying",
"six",
"scikit-image",
"sortedcontainers",
"tabulate",
"tzlocal",
"urllib3",
]
CHOOSE_INSTALL_REQUIRES = [
(
(
"opencv-python",
"opencv-contrib-python",
"opencv-contrib-python-headless",
),
"opencv-python-headless<5,>=4.1",
)
]
def choose_requirement(mains, secondary):
chosen = secondary
for main in mains:
try:
name = re.split(r"[!<>=]", main)[0]
metadata.version(name)
chosen = main
break
except metadata.PackageNotFoundError:
pass
return str(chosen)
def get_install_requirements(install_requires, choose_install_requires):
for mains, secondary in choose_install_requires:
install_requires.append(choose_requirement(mains, secondary))
return install_requires
with open("README.md", "r") as fh:
long_description = fh.read()
def get_version():
if "RELEASE_VERSION" in os.environ:
version = os.environ["RELEASE_VERSION"]
if not version.startswith(VERSION):
raise ValueError(
"Release version does not match version: %s and %s"
% (version, VERSION)
)
return version
return VERSION
setup(
name="voxel51-eta",
version=get_version(),
description="Extensible Toolkit for Analytics",
author="Voxel51, Inc.",
author_email="[email protected]",
url="https://github.com/voxel51/eta",
license="Apache",
long_description=long_description,
long_description_content_type="text/markdown",
packages=find_packages(),
include_package_data=True,
install_requires=get_install_requirements(
INSTALL_REQUIRES, CHOOSE_INSTALL_REQUIRES
),
extras_require={
"pipeline": ["blockdiag", "Sphinx", "sphinxcontrib-napoleon"],
"storage": [
"azure-identity",
"azure-storage-blob>=12.4.0",
"boto3>=1.15",
"google-api-python-client",
"google-cloud-storage>=1.36",
"httplib2<=0.15",
"pysftp",
],
},
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Image Processing",
"Topic :: Scientific/Engineering :: Image Recognition",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Scientific/Engineering :: Visualization",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
entry_points={"console_scripts": ["eta=eta.core.cli:main"]},
python_requires=">=3.6",
cmdclass={"bdist_wheel": BdistWheelCustom},
)