Skip to content
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

Add python-requires in setup.py #8989

Merged
merged 2 commits into from
Sep 22, 2021
Merged

Conversation

aisk
Copy link
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

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
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
Contributor

@acozzette @TeBoring @haberman Please take a look.

@Lothiraldan
Copy link

@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.

python/setup.py Outdated Show resolved Hide resolved
@busunkim96
Copy link
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
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

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
Member

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