-
Notifications
You must be signed in to change notification settings - Fork 110
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
Stop using distutils #6113
Stop using distutils #6113
Conversation
used only in the crawler, and relies on distutils LooseVersion and distutils are getting deprecated. Relevant PR in datalad for distutils removal: datalad/datalad#6113
FWIW -- LooseVersion was used in not used in core LooseVersion was convenient due to its forgiveness and us rarely need "exact" comparison, and largely to capture and then print those versions (e.g. in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks all sane to me. Thanks! I left a few comment which are all relatively minor.
The tests seem to suffer from a str vs bytes problem, seems solvable.
Test failure seems legitimately caused by these changes. |
@mih I've pushed a fix. |
Codecov Report
@@ Coverage Diff @@
## maint #6113 +/- ##
===========================================
- Coverage 90.23% 51.34% -38.89%
===========================================
Files 312 312
Lines 42219 42242 +23
===========================================
- Hits 38095 21691 -16404
- Misses 4124 20551 +16427
Continue to review full report at Codecov.
|
OK, this seems ready. I have kicked off the errored test again, but I expect no failure. The only thing holding me back from merging is the draft state of this PR. @jwodder is this intentionally not meant to be merged? |
@mih It should be merged at some point. The only thing this PR is currently lacking is an alternative to the use of |
@jwodder I would prefer if we get this done here, and leave the |
Then feel free to merge.
I don't know what you're referring to here. |
Thanks! I was referring to keeping |
Distutils was officially deprecated in Python 3.10 and will be removed from the standard library completely in 3.12. This PR thus eliminates almost all of the uses of distutils from the code.
Note that I had to leave in some uses of
LooseVersion
because I wasn't sure whether the stricterpackaging.version.Version
would accomodate all of its uses. If we're only usingLooseVersion
for versions of the formN(.N)*
, thenVersion
will work out fine, but anything more exotic is not guaranteed to work. If we need support for more exotic versions, we may have to roll our own version class.