From edf09443e288a5ceb300da9a9b0478a585b78ab4 Mon Sep 17 00:00:00 2001 From: Johannes Wienke Date: Tue, 13 Oct 2020 19:17:58 +0200 Subject: [PATCH] Limit enum34 installation via environment markers (#8213) Fixes #7050 ### Motivation To prevent installing enum34 on systems where it is not needed, declare the dependency with environment markers. Installing certain versions of enum34 on systems where it is not needed at all, might result in compile time issues. This is the recommended approach discussed here: https://github.com/python-poetry/poetry/issues/1122 ### Modifications * `setup.py`: use environment markers for enum34 instead of custom logic that is not preserved in pypi metadata for the wheel --- pulsar-client-cpp/python/setup.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/pulsar-client-cpp/python/setup.py b/pulsar-client-cpp/python/setup.py index 7c916eb6b14a0..5b98dde183950 100644 --- a/pulsar-client-cpp/python/setup.py +++ b/pulsar-client-cpp/python/setup.py @@ -22,7 +22,6 @@ from distutils.util import strtobool from os import environ import subprocess -import sys from distutils.command import build_ext @@ -57,11 +56,6 @@ def get_name(): print(VERSION) print(NAME) -if sys.version_info[0] == 2: - PY2 = True -else: - PY2 = False - # This is a workaround to have setuptools to include # the already compiled _pulsar.so library class my_build_ext(build_ext.build_ext): @@ -83,6 +77,7 @@ def build_extension(self, ext): 'protobuf>=3.6.1', 'six', 'certifi', + 'enum34>=1.1.9; python_version < "3.4"', # functions dependencies "apache-bookkeeper-client>=4.9.2", @@ -90,10 +85,6 @@ def build_extension(self, ext): "ratelimit" ] -if PY2: - # Python 2 compat dependencies - dependencies += ['enum34>=1.1.9'] - setup( name=NAME, version=VERSION,