-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.py
47 lines (37 loc) · 1.46 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
#!/usr/bin/env python
import os
import subprocess
from setuptools import find_packages, setup
DEFAULT_VERSION = '2.3.0'
def get_and_set_version():
version = os.getenv('TORCHACC_VERSION', DEFAULT_VERSION)
commit_id = subprocess.check_output(['git', 'rev-parse',
'HEAD']).strip().decode('utf-8')[:6]
py_version_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)), 'torchacc', 'version.py')
with open(py_version_path, 'w') as f:
f.write('# Autogenerated file, do not edit!\n')
f.write("__version__ = '{}-{}'\n".format(version, commit_id))
return version
setup_info = dict(
name=os.environ.get('TORCH_ACC_PACKAGE_NAME', 'torchacc'),
version=get_and_set_version(),
author='Alibaba Inc.',
url='http://gitlab.alibaba-inc.com/torchx/torchacc',
description='Torch Accelerator powered by Alibaba',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
# Package info
packages=['torchacc'] + ['torchacc.' + \
pkg for pkg in find_packages('torchacc')],
# add console_scripts
entry_points={
'console_scripts': [
'consolidate_and_reshard_fsdp_ckpts = torchacc.utils.consolidate_and_reshard_ckpts:main',
],
},
# Add _ prefix to the names of temporary build dirs
options={'build': {'build_base': '_build'}, },
zip_safe=True,
)
setup(**setup_info)