forked from awslabs/slapo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
53 lines (43 loc) · 1.47 KB
/
setup.py
File metadata and controls
53 lines (43 loc) · 1.47 KB
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
#!/usr/bin/env python3
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import os
import setuptools
PROJ_NAME = "slapo"
this_dir = os.path.dirname(os.path.abspath(__file__))
if os.getenv("BUILD_VERSION"):
version = os.getenv("BUILD_VERSION")
else:
version_txt = os.path.join(this_dir, "version.txt")
with open(version_txt) as filep:
version = filep.readline().strip()
def write_version_file():
version_path = os.path.join(this_dir, PROJ_NAME, "version.py")
with open(version_path, "w") as f:
f.write("# noqa: C801\n")
f.write(f'__version__ = "{version}"\n')
tag = os.getenv("GIT_TAG")
if tag is not None:
f.write(f'git_tag = "{tag}"\n')
def setup():
write_version_file()
setuptools.setup(
name=PROJ_NAME,
description="Slapo: A Scahedule LAnguage for Progressive Optimization.",
version=version,
setup_requires=[],
install_requires=[],
packages=setuptools.find_packages(),
url="TBA",
python_requires=">=3.7",
classifiers=[
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Operating System :: OS Independent",
],
zip_safe=True,
)
if __name__ == "__main__":
setup()