comparison setup.py @ 2572:7e7f4e344a96

setup: use scm version
author Goffi <goffi@goffi.org>
date Thu, 05 Apr 2018 12:49:25 +0200
parents 4aca060075b7
children fbcdb761981c
comparison
equal deleted inserted replaced
2571:4aca060075b7 2572:7e7f4e344a96
54 54
55 DBUS_DIR = 'dbus-1/services' 55 DBUS_DIR = 'dbus-1/services'
56 DBUS_FILE = 'misc/org.goffi.SAT.service' 56 DBUS_FILE = 'misc/org.goffi.SAT.service'
57 with open('sat/VERSION') as f: 57 with open('sat/VERSION') as f:
58 VERSION = f.read().strip() 58 VERSION = f.read().strip()
59 is_dev_version = VERSION.endswith('D')
60
61
62 def sat_dev_version():
63 """Use mercurial data to compute version"""
64 def version_scheme(version):
65 return VERSION
66
67 def local_scheme(version):
68 # XXX: setuptools_scm seems buggy and the '+' and the '_' are replaced by '-'
69 # breaking the local version identifier scheme
70 # cf. https://github.com/pypa/setuptools_scm/issues/237
71 return "+{rev}_{distance}".format(
72 rev=version.node[1:],
73 distance=version.distance)
74
75 return {'version_scheme': version_scheme,
76 'local_scheme': local_scheme}
59 77
60 78
61 setup(name=NAME, 79 setup(name=NAME,
62 version=VERSION, 80 version=VERSION,
63 description=u'Salut à Toi multipurpose and multi frontend XMPP client', 81 description=u'Salut à Toi multipurpose and multi frontend XMPP client',
76 (os.path.join('share/doc', NAME), ['CHANGELOG', 'COPYING', 'INSTALL', 'README', 'README4TRANSLATORS']), 94 (os.path.join('share/doc', NAME), ['CHANGELOG', 'COPYING', 'INSTALL', 'README', 'README4TRANSLATORS']),
77 (os.path.join('share', DBUS_DIR), [DBUS_FILE]), 95 (os.path.join('share', DBUS_DIR), [DBUS_FILE]),
78 ], 96 ],
79 scripts=['sat_frontends/jp/jp', 'sat_frontends/primitivus/primitivus', 'bin/sat'], 97 scripts=['sat_frontends/jp/jp', 'sat_frontends/primitivus/primitivus', 'bin/sat'],
80 zip_safe=False, 98 zip_safe=False,
99 setup_requires=['setuptools_scm'] if is_dev_version else [],
100 use_scm_version=sat_dev_version if is_dev_version else False,
81 install_requires=install_requires, 101 install_requires=install_requires,
82 package_data={'sat': ['VERSION']}, 102 package_data={'sat': ['VERSION']},
83 python_requires='~=2.7', 103 python_requires='~=2.7',
84 ) 104 )