BingAds / BingAds-Python-SDK

Other
117 stars 162 forks source link

Support --no-binary :all: installation for python 3.6+ #103

Closed DrPyser closed 5 years ago

DrPyser commented 6 years ago

Trying to install this package with no-binary :all: on python 3.6 fails with

Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/local/lib/python3.6/site-packages/setuptools/__init__.py", line 6, in <module>
        import distutils.core
      File "/usr/local/lib/python3.6/distutils/core.py", line 16, in <module>
        from distutils.dist import Distribution
      File "/usr/local/lib/python3.6/distutils/dist.py", line 9, in <module>
        import re
      File "/usr/local/lib/python3.6/re.py", line 142, in <module>
        class RegexFlag(enum.IntFlag):
    AttributeError: module 'enum' has no attribute 'IntFlag'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-nm97xwnn/enum34/

enum34 is incompatible with python 3.6+. The wheel still works for some reason.

I think this can be solved easily by making use of environment markers in setup.py install_requires to only install enum34 for python versions <=3.4. Basically, this: https://github.com/BingAds/BingAds-Python-SDK/blob/965070fb95b982e7985e966c20f5b6ea5ff9b4e6/setup.py#L18 Would become 'enum34;python_version<="3.4"',.

I can do a pull request if it helps.

Thanks!

qitia commented 5 years ago

good point. Will update.

qitia commented 5 years ago

Hi @DrPyser, The update has been introduced since version 12.0.2. Please contact if you see any unexpected. Thanks!