setup: use scm version
This commit is contained in:
parent
ac954f378d
commit
b5a4d8c58d
1 changed files with 20 additions and 0 deletions
20
setup.py
20
setup.py
|
|
@ -56,6 +56,24 @@ DBUS_DIR = 'dbus-1/services'
|
|||
DBUS_FILE = 'misc/org.goffi.SAT.service'
|
||||
with open('sat/VERSION') as f:
|
||||
VERSION = f.read().strip()
|
||||
is_dev_version = VERSION.endswith('D')
|
||||
|
||||
|
||||
def sat_dev_version():
|
||||
"""Use mercurial data to compute version"""
|
||||
def version_scheme(version):
|
||||
return VERSION
|
||||
|
||||
def local_scheme(version):
|
||||
# XXX: setuptools_scm seems buggy and the '+' and the '_' are replaced by '-'
|
||||
# breaking the local version identifier scheme
|
||||
# cf. https://github.com/pypa/setuptools_scm/issues/237
|
||||
return "+{rev}_{distance}".format(
|
||||
rev=version.node[1:],
|
||||
distance=version.distance)
|
||||
|
||||
return {'version_scheme': version_scheme,
|
||||
'local_scheme': local_scheme}
|
||||
|
||||
|
||||
setup(name=NAME,
|
||||
|
|
@ -78,6 +96,8 @@ setup(name=NAME,
|
|||
],
|
||||
scripts=['sat_frontends/jp/jp', 'sat_frontends/primitivus/primitivus', 'bin/sat'],
|
||||
zip_safe=False,
|
||||
setup_requires=['setuptools_scm'] if is_dev_version else [],
|
||||
use_scm_version=sat_dev_version if is_dev_version else False,
|
||||
install_requires=install_requires,
|
||||
package_data={'sat': ['VERSION']},
|
||||
python_requires='~=2.7',
|
||||
|
|
|
|||
Loading…
Reference in a new issue