]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
setup.py: be compatible w/ setuptools <36.2.0 rpm-python3 506/head
authorKefu Chai <kchai@redhat.com>
Thu, 1 Oct 2020 10:09:22 +0000 (18:09 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 1 Oct 2020 10:55:05 +0000 (18:55 +0800)
environment markers are not supported until 36.2.0. on centos7, the
build fails like:

+ python setup.py sdist --formats=bztar
error in ceph-deploy setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers

Signed-off-by: Kefu Chai <kchai@redhat.com>
setup.py

index 4eddb241a58c392c05e4de12e6739987efd1bb83..09b52f1421003988469dc3d5eaabe72d05377b5c 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,8 @@ from setuptools import setup, find_packages
 import os
 import sys
 import ceph_deploy
-
+import pkg_resources
+import setuptools
 
 def read(fname):
     path = os.path.join(os.path.dirname(__file__), fname)
@@ -10,11 +11,18 @@ def read(fname):
     return f.read()
 
 
-install_requires = [
-    "remoto >= 1.1.4",
-    "configparser;python_version<'3.0'",
-    "setuptools < 45.0.0;python_version<'3.0'",
-    "setuptools;python_version>='3.0'"]
+if (pkg_resources.parse_version(setuptools.__version__) >=
+    pkg_resources.parse_version('36.2.0')):
+    install_requires = [
+        "remoto >= 1.1.4",
+        "configparser;python_version<'3.0'",
+        "setuptools < 45.0.0;python_version<'3.0'",
+        "setuptools;python_version>='3.0'"]
+else:
+    install_requires = [
+        "remoto >= 1.1.4",
+        "configparser",
+        "setuptools < 45.0.0"]
 
 setup(
     name='ceph-deploy',