Skip to content

Add python-requires in setup.py#8989

Merged
acozzette merged 2 commits intoprotocolbuffers:masterfrom
aisk:python-requires
Sep 22, 2021
Merged

Add python-requires in setup.py#8989
acozzette merged 2 commits intoprotocolbuffers:masterfrom
aisk:python-requires

Conversation

@aisk
Copy link
Copy Markdown
Contributor

@aisk aisk commented Sep 16, 2021

I saw protobuf have some commits which stop testing and building wheels for python2:

2fbc07b
#8891

And the codes does not support python2 now: #8984

So I think I can assume protobuf does not support python2 for now. I think we should add a python_requires field in setup.py, pip and poetry will check this field and fallback to older version if it in python2 environment.

@google-cla google-cla Bot added the cla: yes label Sep 16, 2021
@Lothiraldan
Copy link
Copy Markdown

According to https://packaging.python.org/guides/dropping-older-python-versions/#dropping-a-python-release and adding such field on other project, I think we need a 3.17.4 release with the python_requires that includes Python 2 and then a release 3.18.1 that drops Python 2 support.

@aisk
Copy link
Copy Markdown
Contributor Author

aisk commented Sep 16, 2021

@Lothiraldan As the document you linked above, and the semver said, I think publish a major version (4.0.0) and yank the current version 3.18.0 is the right way.

@busunkim96
Copy link
Copy Markdown
Contributor

@acozzette @TeBoring @haberman Please take a look.

@Lothiraldan
Copy link
Copy Markdown

@aisk Sorry to ask, but where is the 4.0.0 version? I don't see it on Pypi nor see a tag or branch for 4.0.0.

Comment thread python/setup.py Outdated
@busunkim96
Copy link
Copy Markdown
Contributor

From past releases of protobuf ,it looks like the version numbers need to match the version of the runtime and protoc.

I think what @Lothiraldan suggested should work well:

According to https://packaging.python.org/guides/dropping-older-python-versions/#dropping-a-python-release and adding such field on other project, I think we need a 3.17.4 release with the python_requires that includes Python 2 and then a release 3.18.1 that drops Python 2 support.

@aisk
Copy link
Copy Markdown
Contributor Author

aisk commented Sep 18, 2021

This change will break old codes so it's better to have a major release. But if protobuf have it's own versioning strategy I think it's ok, the python_requires field should solve most problem (except people who have old version pip / setuptools).

@Ark-kun
Copy link
Copy Markdown

Ark-kun commented Sep 22, 2021

I think we need a 3.17.4 release with the python_requires that includes Python 2 and then a release 3.18.1 that drops Python 2 support.

They should probably just release 3.18.1 and yank or delete 3.18.0 from PyPI

@acozzette acozzette merged commit b75bb09 into protocolbuffers:master Sep 22, 2021
@acozzette
Copy link
Copy Markdown

Thanks, @aisk. I am getting ready to do a 3.18.1 release that will include this fix.

@aisk aisk deleted the python-requires branch September 23, 2021 06:37
acozzette pushed a commit to acozzette/protobuf that referenced this pull request Sep 24, 2021
* Add python-requires in setup.py

* Update setup.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants