Skip to content

3.18.0 isn't compatible with Python 2 despite being installable #8984

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
convoliution opened this issue Sep 15, 2021 · 5 comments
Closed

3.18.0 isn't compatible with Python 2 despite being installable #8984

convoliution opened this issue Sep 15, 2021 · 5 comments
Labels

Comments

@convoliution
Copy link

convoliution commented Sep 15, 2021

What version of protobuf and what language are you using?
Version: v3.18.0
Language: Python

What operating system (Linux, Windows, ...) and version?
macOS Mojave 10.14.6

What runtime / compiler are you using (e.g., python version or gcc version)

Python 2.7.18 (default, Mar 30 2021, 14:20:09) 
[GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.46.4)] on darwin

What did you do?
Steps to reproduce the behavior:

  1. Activate a Python 2 environment
  2. pip install protobuf==3.18.0
  3. python -c "from google.protobuf import descriptor"

What did you expect to see
Either:

  • ERROR: Could not find a version that satisfies the requirement protobuf==3.18.0
    in (2)
  • no errors in (3)

What did you see instead?

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/convoliution/.pyenv/versions/dev2/lib/python2.7/site-packages/google/protobuf/descriptor.py", line 113
    class DescriptorBase(metaclass=DescriptorMetaclass):
                                  ^
SyntaxError: invalid syntax

in (3)

@elharo elharo added the python label Sep 15, 2021
jsirois added a commit to jsirois/pex that referenced this issue Sep 16, 2021
The 3.18.0 release brought a new py2.py3 wheel that has Python 3 syntax
code in it; so avoid this release in tests.

See: protocolbuffers/protobuf#8984
jsirois added a commit to pex-tool/pex that referenced this issue Sep 16, 2021
The 3.18.0 release brought a new py2.py3 wheel that has Python 3 syntax
code in it; so avoid this release in tests.

See: protocolbuffers/protobuf#8984
@srenauld
Copy link

This breaks nrfutil, rendering a major provider's CLI tool for DFU upgrades inoperable with no way to pin this dependency.

@odelrio
Copy link

odelrio commented Sep 16, 2021

https://github.com/googleapis/python-api-core depends on protobuf and this version breaks Python2.7-based builds. My workaround was to force v3.17.3 by defining a new dependency.

sethmlarson added a commit to elastic/elasticsearch-py that referenced this issue Sep 17, 2021
busunkim96 added a commit to googleapis/python-api-core that referenced this issue Sep 20, 2021
Fixes #276 

The latest versions of Cloud libraries (except for google-cloud-storage) have moved on to python >= 3.6. However, users of the storage library and older Cloud libraries may be impacted.

protocolbuffers/protobuf#8984
busunkim96 added a commit to googleapis/python-api-core that referenced this issue Sep 20, 2021
Fixes #276. This PR is being made to the v1 branch and will be released manually in 1.31.3.

Protobuf 3.18.0 removed support for Python 2.7 and 3.5 https://github.com/protocolbuffers/protobuf/releases/tag/v3.18.0. Because the protobuf library does not use python_requires, pip will try to install it even on Python 2.7. A new release of google-api-core should result in google-cloud-* library users getting the last version of protobuf they can use.

The latest versions of Cloud libraries (except for google-cloud-storage) have moved on to python >= 3.6. However, users google-cloud-storage and older Cloud libraries may be impacted.

Also see protocolbuffers/protobuf#8984
@busunkim96
Copy link
Contributor

@odelrio I just released a 1.x version of google-api-core that pins to protobuf <3.18.0. https://pypi.org/project/google-api-core/1.31.3/

@alanyee
Copy link

alanyee commented Mar 25, 2022

#9045

@convoliution
Copy link
Author

Ok, I went ahead and yanked 3.18.0, so hopefully that should fix the problem. Users who still need Python 2 support can keep using 3.17.3.

#9045 (comment)

Perfect!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants