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

python 3.12 removes distutils #236

Open
wdpypere opened this issue Nov 13, 2023 · 7 comments
Open

python 3.12 removes distutils #236

wdpypere opened this issue Nov 13, 2023 · 7 comments

Comments

@wdpypere
Copy link
Contributor

we should port away from it. https://setuptools.pypa.io/en/latest/deprecated/distutils-legacy.html

@boegel
Copy link
Member

boegel commented Jan 13, 2025

There's already problems popping up with Python 3.11 too:

Traceback (most recent call last):
  File "/Volumes/work/vsc-mympirun/setup.py", line 31, in <module>
    import vsc.install.shared_setup as shared_setup
  File "/Volumes/work/vsc-install/lib/vsc/install/shared_setup.py", line 76, in <module>
    from setuptools.command.test import ScanningLoader
ImportError: cannot import name 'ScanningLoader' from 'setuptools.command.test'

@stdweird
Copy link
Member

@boegel what does this error have to do with the distutils being stripped/refactored?

@boegel
Copy link
Member

boegel commented Jan 13, 2025

It's not, it's related to changes in setuptools, I can open a dedicated issue on that I guess

@stdweird
Copy link
Member

yes please. and mention what setuptools version you use.

@stdweird
Copy link
Member

@wdpypere what problem did you actually see? the code was already compatible with local distutils it seems. (or i can't trigger it)
the issue that @boegel encountered is because setuptools decided to remove the test command by breaking it (it was deprecated for long long time). not sure how to resolve in the future; we can always ship the test command with vsc-install, that is no big issue imho.

@stdweird
Copy link
Member

@boegel you can also encounter the scanning loader error when installing with a too recent pip (anything older then 23). the error is a bit different

@stdweird
Copy link
Member

Option 1:
Create a file called constraints.txt

setuptools<72

Then set PIP_CONSTRAINT=/path/to/constraints.txt

Option 2: Use --no-build-isolation (and make sure you have an old setuptools installed)

pypa/setuptools#4519 (comment)

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

No branches or pull requests

3 participants