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

Work around incompatibility between Python 3.12 and setuptools<66.1 #140

Merged
merged 3 commits into from
Dec 15, 2023

Conversation

diazona
Copy link
Owner

@diazona diazona commented Dec 13, 2023

Older versions of setuptools fail to import distutils on Python 3.12, presumably due to the removal of distutils from the standard library. This bug was fixed in pypa/setuptools#3685, and setuptools 66.1 was the first version released that includes the fix. (I'm not sure exactly how that PR fixed the bug, but it doesn't matter.)

Because setuptools 66.0 understandably does not declare itself to be incompatible with Python 3.12, I'm bumping our minimum setuptools version requirement on that Python version to reflect the incompatibility, and adjusting the CI configuration to match.

Closes #139

Older versions of setuptools fail to import distutils on Python 3.12,
presumably due to the removal of distutils from the standard library.
This bug was fixed in pypa/setuptools#3685, and
setuptools 66.1 was the first version released that includes the fix.
(I'm not sure exactly how that PR fixed the bug, but it doesn't matter.)

Because setuptools 66.0 understandably does not declare itself to be
incompatible with Python 3.12, I'm recording that constraint here.
Since setuptools<66.1 is not compatible with Python 3.12, I'm changing
our CI job that tests minimum versions to use setuptools 66.1 when
running under Python 3.12.

Currently we don't actually run that particular configuration with
Python 3.12, but we will soon.

P.S. Writing code in YAML sucks :-(
@diazona diazona added this to the v0.2 milestone Dec 13, 2023
@diazona
Copy link
Owner Author

diazona commented Dec 13, 2023

I rebased #137 on top of this and checked that its tests pass. 👍

Copy link
Collaborator

@sjlongland sjlongland left a comment

Choose a reason for hiding this comment

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

Gotta love it when an upstream change pulls the rug on a downstream project. :-)

@diazona diazona merged commit bed73f2 into main Dec 15, 2023
12 checks passed
@diazona diazona deleted the python-312-old-setuptools/1/dev branch December 15, 2023 22:06
@diazona
Copy link
Owner Author

diazona commented Dec 15, 2023

Heh, indeed... But it happens, and in this case it's really a good change overall IMO, so no complaints.

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.

"No module named 'distutils'" with old setuptools on Python 3.12
2 participants