-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
105 lines (86 loc) · 2.96 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
import os
from setuptools import find_packages, setup
def read(rel_path: str) -> str:
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, rel_path), encoding="utf-8") as fp:
return fp.read()
def get_version(rel_path: str) -> str:
for line in read(rel_path).splitlines():
if line.startswith("__version__"):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
raise RuntimeError("Unable to find version string.")
# Package meta-data.
NAME = "learnware"
DESCRIPTION = "learnware market project"
REQUIRES_PYTHON = ">=3.6.0"
VERSION = get_version("learnware/__init__.py")
# BEFORE importing setuptools, remove MANIFEST. Otherwise it may not be
# properly updated when the contents of directories change (true for distutils,
# not sure about setuptools).
if os.path.exists("MANIFEST"):
os.remove("MANIFEST")
MACOS = 0
WINDOWS = 1
LINUX = 2
def get_platform():
import platform
sys_platform = platform.platform().lower()
if "windows" in sys_platform:
return WINDOWS
elif "macos" in sys_platform:
return MACOS
elif "linux" in sys_platform:
return LINUX
raise SystemError("Learnware only support MACOS/Linux/Windows")
# What packages are required for this module to be executed?
# `estimator` may depend on other packages. In order to reduce dependencies, it is not written here.
REQUIRED = [
"numpy>=1.19.2",
"pandas>=0.25.1",
"scipy>=1.0.0",
"matplotlib>=3.1.3",
"torch>=1.11.0",
"cvxopt>=1.3.0",
"tqdm>=4.65.0",
"scikit-learn>=0.22",
"joblib>=1.2.0",
"pyyaml>=6.0",
"fire>=0.3.1",
"lightgbm>=3.3.0",
"psutil>=5.9.4",
"torchvision>=0.15.1",
"tensorflow>=2.4.0",
]
if get_platform() != MACOS:
REQUIRED.append("faiss-cpu>=1.7.1")
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
if __name__ == "__main__":
setup(
name=NAME,
version=VERSION,
license="MIT Licence",
url="https://git.nju.edu.cn/learnware/learnware-market",
packages=find_packages(),
include_package_data=True,
description=DESCRIPTION,
long_description=long_description,
long_description_content_type="text/markdown",
python_requires=REQUIRES_PYTHON,
install_requires=REQUIRED,
classifiers=[
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Programming Language :: Python",
"Topic :: Software Development",
"Topic :: Scientific/Engineering",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
],
)