Группа :: Development/Python3
Пакет: python3-module-tenacity
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: tenacity-fix-py2.patch
Скачать
Скачать
From 87e2cb8765d7f8af40037bf4e90178e88213dab9 Mon Sep 17 00:00:00 2001
From: John Naulty <jnaulty@gmail.com>
Date: Wed, 4 Oct 2017 17:25:28 -0700
Subject: [PATCH] python2 bdist_rpm build fix #88
to test on centos build with python2 and python3
e.g.
python2:
`python setup.py bdist_rpm --python /usr/bin/python2`
python3:
`python setup.py bdist_rpm --python /usr/bin/python3`
---
setup.py | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/setup.py b/setup.py
index 186fa00..c561b2e 100644
--- a/setup.py
+++ b/setup.py
@@ -13,8 +13,23 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import os
+import shutil
+import sys
+
import setuptools
+
+# Useful for very coarse version differentiation.
+PY2 = sys.version_info[0] == 2
+# files that can only be compiled with Python 3
+PY3_FILES_PATH = ['tenacity/_asyncio.py', 'tenacity/tests/test_asyncio.py']
+if PY2:
+ for fn in PY3_FILES_PATH:
+ print(os.listdir(os.getcwd()))
+ if os.path.isfile(fn):
+ shutil.move(fn, '%s.null' % fn)
+
setuptools.setup(
setup_requires=['pbr'],
pbr=True)