/
setup.py
98 lines (79 loc) · 2.29 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
# -*- coding: utf-8 -*-
import os
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
HERE = os.path.dirname(os.path.abspath((__file__)))
# meta infos
NAME = "aw_nas"
DESCRIPTION = "The nas implementation of our group."
with open(os.path.join(os.path.dirname(__file__), "aw_nas", "VERSION")) as f:
VERSION = f.read().strip()
AUTHOR = "foxfi"
EMAIL = "foxdoraame@gmail.com"
# package contents
MODULES = []
PACKAGES = find_packages(exclude=["tests.*", "tests"])
# dependencies
INSTALL_REQUIRES = [
"torch>=1.0.0", # torch
"torchvision>=0.4.0", # torchvision, for torchvision.ops.nms
"numpy", # math lib
"scipy", # math lib
"six", # 2-3 compatability
"PyYaml", # config file parsing
"click", # command line interface
"graphviz", # visualize architecture dag
# other utils
"imageio",
"setproctitle"
]
EXTRAS_REQUIRE = {
"vis": ["tensorboardX<=1.6"],
"det": ["opencv-python", "pycocotools", "torchvision>=0.4.0"]
}
TESTS_REQUIRE = [
"pytest",
"pytest-cov",
]
def read_long_description(filename):
path = os.path.join(HERE, filename)
if os.path.exists(path):
return open(path).read()
return ""
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = ["tests/", "-x", "--cov"]
self.test_suite = True
def run_tests(self):
# import here, cause outside the eggs aren"t loaded
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)
setup(
name=NAME,
version=VERSION,
license="MIT",
url="https://github.com/walkerning/aw_nas",
author=AUTHOR,
author_email=EMAIL,
description=DESCRIPTION,
long_description=read_long_description("README.md"),
py_modules=MODULES,
packages=PACKAGES,
entry_points={
"console_scripts": [
"awnas=aw_nas.main:main",
"awnas-hw=aw_nas.main_hardware:main"
]
},
install_requires=INSTALL_REQUIRES,
extras_require=EXTRAS_REQUIRE,
tests_require=TESTS_REQUIRE,
cmdclass={"test": PyTest},
zip_safe=True,
package_data={
"aw_nas": ["VERSION"]
}
)