forked from TRI-ML/dgp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
64 lines (51 loc) · 1.73 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
# Copyright 2019 Toyota Research Institute. All rights reserved.
import importlib
import os
from setuptools import find_packages, setup
from setuptools.command.build_py import build_py
from setuptools.command.develop import develop
from setuptools.command.install import install
def build_protos():
SETUP_DIR = os.path.dirname(os.path.abspath(__file__))
from grpc.tools import command
command.build_package_protos(SETUP_DIR)
class CustomBuildPyCommand(build_py):
def run(self):
build_protos()
build_py.run(self)
class CustomInstallCommand(install):
def run(self):
build_protos()
install.run(self)
class CustomDevelopCommand(develop):
def run(self):
build_protos()
develop.run(self)
__version__ = importlib.import_module('dgp').__version__
with open('requirements.txt', encoding='utf-8') as f:
requirements = f.read().splitlines()
packages = find_packages(exclude=['tests'])
setup(
name="dgp",
version=__version__,
description="Dataset Governance Policy (DGP) for Autonomous Vehicle ML datasets.",
long_description=open('README.md', encoding='utf-8').read(),
long_description_content_type='text/markdown',
author="Toyota Research Institute",
author_email='ml@tri.global',
url="https://github.com/TRI-ML/dgp",
packages=packages,
entry_points={'console_scripts': [
'dgp_cli=dgp.cli:cli',
]},
include_package_data=True,
setup_requires=['cython==0.29.21', 'grpcio==1.41.0', 'grpcio-tools==1.41.0'],
install_requires=requirements,
zip_safe=False,
python_requires='>=3.6',
cmdclass={
'install': CustomInstallCommand,
'develop': CustomDevelopCommand,
'build_py': CustomBuildPyCommand
}
)