-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.py
38 lines (30 loc) · 942 Bytes
/
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
import setuptools
def branch_dependent_version():
import setuptools_scm
def void(version):
return ""
def version_scheme(version):
if version.branch not in ["main", "master"]:
_v = setuptools_scm.get_version(local_scheme=void)
else:
_v = str(version.tag)
return _v
def local_scheme(version):
if version.branch not in ["main", "master"]:
_v = setuptools_scm.get_version(version_scheme=void)
else:
_v = ""
return _v
scm_version = {
"root": ".",
"relative_to": __file__,
"version_scheme": version_scheme,
"local_scheme": local_scheme
# >> "no-local-version" not quit good enough
# >> on dev "node-and-timestamp", # version_scheme,
}
return scm_version
setuptools.setup(
use_scm_version=branch_dependent_version,
setup_requires=["setuptools_scm"],
)