forked from Media-Smart/volksdep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
71 lines (58 loc) · 2.06 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
import os
import glob
import shutil
from setuptools import setup, find_packages
from setuptools.command.install import install
from distutils.cmd import Command
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
class InstallCommand(install):
description = "Builds the package"
def initialize_options(self):
install.initialize_options(self)
def finalize_options(self):
install.finalize_options(self)
def run(self):
install.run(self)
class CleanCommand(Command):
"""Custom clean command to tidy up the project root."""
PY_CLEAN_FILES = ['./build', './dist', './__pycache__', './*.pyc', './*.tgz', './*.egg-info', './.eggs']
description = "Command to tidy up the project root"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
root_dir = os.path.dirname(os.path.realpath(__file__))
for path_spec in self.PY_CLEAN_FILES:
# Make paths absolute and relative to this path
abs_paths = glob.glob(os.path.normpath(os.path.join(root_dir, path_spec)))
for path in [str(p) for p in abs_paths]:
if not path.startswith(root_dir):
# Die if path in CLEAN_FILES is absolute + outside this directory
raise ValueError("%s is not a path inside %s" % (path, root_dir))
print('Removing %s' % os.path.relpath(path))
shutil.rmtree(path)
setup(
name='volksdep',
version='3.2.0',
packages=find_packages(),
url='https://github.com/Media-Smart/volksdep',
author='hxcai',
author_email='[email protected]',
description='An easy toolbox for deploying and accelerating PyTorch, Onnx and Tensorflow models with TensorRT.',
long_description=read('README.md'),
setup_requires=[
'tensorrt>=7.1.0.*',
],
install_requires=[
'numpy',
'torch>=1.4.*',
],
python_requires='>3.6',
cmdclass={
'clean': CleanCommand,
},
zip_safe=False,
)