Repository: googleapis/google-cloud-python

Issue:
(google-cloud-vision) enum34 should not be installed on Python 3.4+
The enum34 breaks my code (python3.6), it is a known issue that enum34 doesn't work on Python 3.4+

Please refer to the discussion over here:
[https://bitbucket.org/stoneleaf/enum34/issues/5/enum34-incompatible-with-python-35#comment-19462547](https://bitbucket.org/stoneleaf/enum34/issues/5/enum34-incompatible-with-python-35#comment-19462547)

suggested fix in vision/setup.py

```python
REQUIREMENTS = [
-    'enum34',
    'google-cloud-core >= 0.24.0, < 0.25dev',
    'gapic-google-cloud-vision-v1 >= 0.90.3, < 0.91dev',
]

+if sys.version_info < (3, 4):
+    # Backport of Python 3.4 enums to earlier versions
+   REQUIREMENTS.append('enum34')

setup(
    name='google-cloud-vision',
    version='0.24.0',
    description='Python Client for Google Cloud Vision',
    long_description=README,
    namespace_packages=[
        'google',
        'google.cloud',
    ],
    packages=find_packages(exclude=('tests*',)),
    install_requires=REQUIREMENTS,
    **SETUP_BASE
)
```



Discussion:
@matrixl Can you link to the known issue? Our unit tests run in Python 3.4, 3.5, 3.6 and our system tests run in 3.6 without **any issue** at all.
Here is the issue reported in other project.
[https://github.com/donnemartin/saws/issues/55](https://github.com/donnemartin/saws/issues/55)

Also some discussion over here.
[https://bitbucket.org/stoneleaf/enum34/issues/5/enum34-incompatible-with-python-35#comment-19462547](https://bitbucket.org/stoneleaf/enum34/issues/5/enum34-incompatible-with-python-35#comment-19462547)
Both of this indicate that the incompatibility was resolved 2 years ago. Am I somehow misreading?
Yes, those issues have been fixed, but the way they fixed it is to only install enum34 with Python < 3.4.

[https://github.com/donnemartin/saws/commit/f109bc8f534905797ee44239cb766ea3de4ceb5d](https://github.com/donnemartin/saws/commit/f109bc8f534905797ee44239cb766ea3de4ceb5d)

Here is the latest post in 2017.
[https://bitbucket.org/stoneleaf/enum34/issues/19/enum34-isnt-compatible-with-python-36](https://bitbucket.org/stoneleaf/enum34/issues/19/enum34-isnt-compatible-with-python-36)

>Issue #19 **WONTFIX**
>enum34 isn't compatible with python 3.6

It was tagged as "WONTFIX", so the only way to fix it is to only require it with Python < 3.4
Gotcha, thanks for digging @matrixl. So the issue isn't that our code is broken on it's own, just that it steps in front of `import enum` and stops you from using the newest features of `enum`?

@jonparrott WDYT of adding `enum34;python_version<"3.4"` in our requirements?
@dhermes I'm fine with that.

Resolving patch:
diff --git a/vision/setup.py b/vision/setup.py
--- a/vision/setup.py
+++ b/vision/setup.py
@@ -51,10 +51,12 @@
 
 
 REQUIREMENTS = [
-    'enum34',
     'google-cloud-core >= 0.24.0, < 0.25dev',
     'gapic-google-cloud-vision-v1 >= 0.90.3, < 0.91dev',
 ]
+EXTRAS_REQUIRE = {
+    ':python_version<"3.4"': ['enum34'],
+}
 
 setup(
     name='google-cloud-vision',
@@ -67,5 +69,6 @@
     ],
     packages=find_packages(exclude=('tests*',)),
     install_requires=REQUIREMENTS,
+    extras_require=EXTRAS_REQUIRE,
     **SETUP_BASE
 )


Test patch: