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 support for python 3.11 #5

Merged
merged 1 commit into from
Jan 3, 2024
Merged

Conversation

jeblair
Copy link
Contributor

@jeblair jeblair commented Jan 3, 2024

The cython generated C code is different for 3.11 vs 3.10, so relying on pip using an sdist with that file included doesn't work. That is to say, that "pip install sha256" doesn't work on 3.11 with the 0.3 release on pypi.

This change updates setup.py to the current recommendation from cython (which removes the sdist step). It adds a pyproject.toml so that cython is recognized as a build-time dependency in recent pip versions. Package classifiers are updated to include 3.11. Finally the sha256 package version is updated to 0.4 to prepare for a future release.

Copy link
Member

@markpeek markpeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for putting this PR together. A couple of minor changes.

setup.cfg Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
The cython generated C code is different for 3.11 vs 3.10, so
relying on pip using an sdist with that file included doesn't work.
That is to say, that "pip install sha256" doesn't work on 3.11 with
the 0.3 release on pypi.

This change updates setup.py to the current recommendation from
cython (which removes the sdist step).  It adds a pyproject.toml
so that cython is recognized as a build-time dependency in recent
pip versions.  Package classifiers are updated to include 3.11
and 3.12, and dropping the EOL 3.7. Finally the sha256 package
version is updated to 1.0 to prepare for a future release.
@markpeek
Copy link
Member

markpeek commented Jan 3, 2024

Thanks for the additional changes. I checked out the code but not sure the right way to test and then package it for uploading to PyPI. Seems like there needs to be a requirements-dev.txt for Cython to be installed in order for these to work from a newly checkout virtual environment:

python setup.py sdist
python setup.py test

and then I can use twine for the upload. Want to make sure I document the right commands for repeatable builds and uploads.

@jeblair
Copy link
Contributor Author

jeblair commented Jan 3, 2024

Some of this is new to me too. :) But as I currently understand it:

python setup.py test is deprecated and should probably be replaced with something like tox or nox.

Then the new way to build and upload would be (according to https://packaging.python.org/en/latest/tutorials/packaging-projects/ ):

python3 -m pip install --upgrade build twine
python3 -m build
python3 -m twine upload dist/*

I think that will work without any additional requirements files because the cython dep is specified in pyproject.toml and the "build" and "pip" commands use that.

Copy link
Member

@markpeek markpeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@markpeek markpeek merged commit 165765c into cloudtools:master Jan 3, 2024
@markpeek
Copy link
Member

markpeek commented Jan 4, 2024

@jeblair Thank you for the changes and insights. Release 1.0 is now available on github and PyPI.

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

Successfully merging this pull request may close these issues.

2 participants