summaryrefslogtreecommitdiffstats
path: root/ipasetup.py.in
diff options
context:
space:
mode:
authorChristian Heimes <cheimes@redhat.com>2016-11-22 16:08:46 +0100
committerMartin Basti <mbasti@redhat.com>2016-12-01 15:00:40 +0100
commit027fc32fe0424659c5aecb4531299fe8d4a503d3 (patch)
tree60093d02d2ef35414e63f6160a6eba3281e7f42f /ipasetup.py.in
parent289982e02fa6bef700fe2c1900ddbed864876faa (diff)
downloadfreeipa-027fc32fe0424659c5aecb4531299fe8d4a503d3.tar.gz
freeipa-027fc32fe0424659c5aecb4531299fe8d4a503d3.tar.xz
freeipa-027fc32fe0424659c5aecb4531299fe8d4a503d3.zip
Backwards compatibility with setuptools 0.9.8
Setuptools 0.9.8 does not support PEP 440 version schema with +git suffix and PEP 508 env markers. https://fedorahosted.org/freeipa/ticket/6468 Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Pavel Vomacka <pvomacka@redhat.com>
Diffstat (limited to 'ipasetup.py.in')
-rw-r--r--ipasetup.py.in31
1 files changed, 25 insertions, 6 deletions
diff --git a/ipasetup.py.in b/ipasetup.py.in
index 2200e4b2f..9ce0b356c 100644
--- a/ipasetup.py.in
+++ b/ipasetup.py.in
@@ -50,16 +50,27 @@ class build_py(setuptools_build_py):
return setuptools_build_py.build_module(self, module,
module_file, package)
+import setuptools
+
+VERSION = '@VERSION@'
+
+SETUPTOOLS_VERSION = tuple(int(v) for v in setuptools.__version__.split("."))
+
+# backwards compatibility with setuptools 0.9.8, split off +gitHASH suffix
+# PEP 440 was introduced in setuptools 8.
+if SETUPTOOLS_VERSION < (8, 0, 0):
+ VERSION = VERSION.split('+')[0]
+
PACKAGE_VERSION = {
'cryptography': 'cryptography >= 1.3.1',
'dnspython': 'dnspython >= 1.13',
'gssapi': 'gssapi > 1.2.0',
- 'ipaclient': 'ipaclient == @VERSION@',
- 'ipalib': 'ipalib == @VERSION@',
- 'ipaplatform': 'ipaplatform == @VERSION@',
- 'ipapython': 'ipapython == @VERSION@',
- 'ipaserver': 'ipaserver == @VERSION@',
+ 'ipaclient': 'ipaclient == {}'.format(VERSION),
+ 'ipalib': 'ipalib == {}'.format(VERSION),
+ 'ipaplatform': 'ipaplatform == {}'.format(VERSION),
+ 'ipapython': 'ipapython == {}'.format(VERSION),
+ 'ipaserver': 'ipaserver == {}'.format(VERSION),
'kdcproxy': 'kdcproxy >= 0.3',
'netifaces': 'netifaces >= 0.10.4',
'pyldap': 'pyldap >= 2.4.15',
@@ -70,7 +81,7 @@ PACKAGE_VERSION = {
common_args = dict(
- version="@VERSION@",
+ version=VERSION,
license="GPLv3",
author="FreeIPA Developers",
author_email="freeipa-devel@redhat.com",
@@ -126,6 +137,14 @@ def ipasetup(name, doc, **kwargs):
cmdclass = setup_kwargs.setdefault('cmdclass', {})
cmdclass['build_py'] = build_py
+ # Env markers like ":python_version<'3.3'" are not supported by
+ # setuptools < 18.0.
+ if 'extras_require' in setup_kwargs and SETUPTOOLS_VERSION < (18, 0, 0):
+ for k in list(setup_kwargs['extras_require']):
+ if k.startswith(':'):
+ req = setup_kwargs.setdefault('install_requires', [])
+ req.extend(setup_kwargs['extras_require'].pop(k))
+
os.chdir(local_path)
try:
# BEFORE importing distutils, remove MANIFEST. distutils doesn't