Skip to content

Add support for python 3.11 - #5

Merged
markpeek merged 1 commit into
cloudtools:masterfrom
jeblair:master
Jan 3, 2024
Merged

Add support for python 3.11#5
markpeek merged 1 commit into
cloudtools:masterfrom
jeblair:master

Conversation

@jeblair

@jeblair jeblair commented Jan 3, 2024

Copy link
Copy Markdown
Contributor

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.

@markpeek markpeek left a comment

Copy link
Copy Markdown
Member

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.

Comment thread setup.cfg
Comment thread setup.py Outdated
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

markpeek commented Jan 3, 2024

Copy link
Copy Markdown
Member

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

jeblair commented Jan 3, 2024

Copy link
Copy Markdown
Contributor Author

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.

@markpeek markpeek left a comment

Copy link
Copy Markdown
Member

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

markpeek commented Jan 4, 2024

Copy link
Copy Markdown
Member

@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