-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·64 lines (53 loc) · 2.03 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
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import os
from os import path
from setuptools import find_packages, setup
def get_version():
init_py_path = path.join(
path.abspath(path.dirname(__file__)), "fvbitcore", "__init__.py"
)
init_py = open(init_py_path, "r").readlines()
version_line = [l.strip() for l in init_py if l.startswith("__version__")][0]
version = version_line.split("=")[-1].strip().strip("'\"")
# Used by CI to build nightly packages. Users should never use it.
# To build a nightly wheel, run:
# BUILD_NIGHTLY=1 python setup.py sdist
if os.getenv("BUILD_NIGHTLY", "0") == "1":
from datetime import datetime
date_str = datetime.today().strftime("%Y%m%d")
# pip can perform proper comparison for ".post" suffix,
# i.e., "1.1.post1234" >= "1.1"
version = version + ".post" + date_str
new_init_py = [l for l in init_py if not l.startswith("__version__")]
new_init_py.append('__version__ = "{}"\n'.format(version))
with open(init_py_path, "w") as f:
f.write("".join(new_init_py))
return version
readme_path = path.join(path.abspath(path.dirname(__file__)), "README.md")
with open(readme_path, "r", encoding="utf-8") as handle:
readme_content = handle.read()
setup(
name="fvbitcore",
version=get_version(),
author="Hasso Plattner Institute",
license="Apache 2.0",
url="https://github.com/hpi-xnor/fvbitcore",
description="Fork of https://github.com/facebookresearch/fvcore with support for bitorch",
long_description=readme_content,
long_description_content_type="text/markdown",
python_requires=">=3.6",
install_requires=[
"numpy",
"yacs>=0.1.6",
"pyyaml>=5.1",
"tqdm",
"termcolor>=1.1",
"Pillow",
"tabulate",
"iopath>=0.1.7",
"dataclasses; python_version<'3.7'",
],
extras_require={"all": ["shapely"]},
packages=find_packages(exclude=("tests",)),
)