add test-time dependency on setuptools #776
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Contributes to #775, follow-up to #773.
Some nightly Python 3.12 tests are failing in this repo, as a result of the following:
GPUtil
GPUtil
was last updated 5+ years ago, and unconditionally importsdistutils
(code link)distutils
was removed from the Python standard library in Python 3.12This proposes a temporary fix... adding a test-time dependency on
setuptools
.import distutils
will work in an environment wheresetuptools
is installed.Benefits of these changes
Fixes nightly tests, without imposing any new requirements of users of
cucim
.Notes for Reviewers
At some point,
setuptools
will likely removedistutils
or the parts of it thatGPUtil
needs, and these tests will break in this way again. I've listed out some alternatives in #775, those should be explored at some point.How I tested this
On a machine with CUDA 12.2 and V100s, I can reproduce the test failures like this:
After running
pip install setuptools
, those tests pass 😁