Skip to content

Commit

Permalink
Limit enum34 installation via environment markers (#8213)
Browse files Browse the repository at this point in the history
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:
python-poetry/poetry#1122

### Modifications

* `setup.py`: use environment markers for enum34 instead of custom logic that is not preserved in pypi metadata for the wheel
  • Loading branch information
languitar authored Oct 13, 2020
1 parent fdb3b81 commit f2014eb
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from distutils.util import strtobool
from os import environ
import subprocess
import sys

from distutils.command import build_ext

Expand Down Expand Up @@ -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):
Expand All @@ -83,17 +77,14 @@ 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",
"prometheus_client",
"ratelimit"
]

if PY2:
# Python 2 compat dependencies
dependencies += ['enum34>=1.1.9']

setup(
name=NAME,
version=VERSION,
Expand Down

0 comments on commit f2014eb

Please sign in to comment.