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

Some tests use distutils module that has been removed in python 3.12 #1142

Closed
loqs opened this issue Mar 17, 2024 · 3 comments · Fixed by #1146
Closed

Some tests use distutils module that has been removed in python 3.12 #1142

loqs opened this issue Mar 17, 2024 · 3 comments · Fixed by #1146
Assignees
Labels
dependencies Pull requests that update a dependency file help wanted Contributions welcome! maintenance General technical debt tests related to tests (not necessarily CI/CD)

Comments

@loqs
Copy link
Contributor

loqs commented Mar 17, 2024

PEP 632 deprecated distutils in python 3.10 and its removal followed in python 3.12.

It is used in three test files:

import distutils.spawn

import distutils.spawn


Failure to find the module causes testing to failure during test discovery. The suggested replacement for distutils.spawn.find_executable as per PEP 632 is shutil.which.

@briantist briantist self-assigned this Mar 22, 2024
@briantist briantist added help wanted Contributions welcome! tests related to tests (not necessarily CI/CD) maintenance General technical debt labels Mar 22, 2024
@briantist
Copy link
Contributor

@loqs thanks for raising this. I remember making this replacement in some other project I was working on... and now can't remember which 😅 but the strange thing is, we already test against 3.12 and it seems like there are no issues

Could you let me know where you are seeing failures? Running locally?

Also if you'd like to put up a PR to change this it would be appreciated.

loqs added a commit to loqs/hvac that referenced this issue Mar 23, 2024
distutils was removed in python 3.12.
Closes hvac#1142
@loqs
Copy link
Contributor Author

loqs commented Mar 23, 2024

Could you let me know where you are seeing failures? Running locally?

Yes locally on Arch Linux. One explanation you are not seeing the issue would be if setuptools is installed as that bundles distutils.

Also if you'd like to put up a PR to change this it would be appreciated.

Done.

briantist added a commit that referenced this issue Mar 24, 2024
* Replace distutils.spawn with shutil.which

distutils was removed in python 3.12.
Closes #1142

* remove setuptools from docs dependencies

* Revert "remove setuptools from docs dependencies"

This reverts commit aadecf4.

* describe setuptools dependency

---------

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
@briantist
Copy link
Contributor

Related (probably should have caught this earlier):

@briantist briantist added the dependencies Pull requests that update a dependency file label Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file help wanted Contributions welcome! maintenance General technical debt tests related to tests (not necessarily CI/CD)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants