This is an automated email from the ASF dual-hosted git repository.

sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new edf0944  Limit enum34 installation via environment markers (#8213)
edf0944 is described below

commit edf09443e288a5ceb300da9a9b0478a585b78ab4
Author: Johannes Wienke <[email protected]>
AuthorDate: Tue Oct 13 19:17:58 2020 +0200

    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 7c916eb..5b98dde 100644
--- a/pulsar-client-cpp/python/setup.py
+++ b/pulsar-client-cpp/python/setup.py
@@ -22,7 +22,6 @@ from distutils.core import Extension
 from distutils.util import strtobool
 from os import environ
 import subprocess
-import sys
 
 from distutils.command import build_ext
 
@@ -57,11 +56,6 @@ NAME = 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 @@ dependencies = [
     '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 @@ dependencies = [
     "ratelimit"
 ]
 
-if PY2:
-    # Python 2 compat dependencies
-    dependencies += ['enum34>=1.1.9']
-
 setup(
     name=NAME,
     version=VERSION,

Reply via email to