-
Notifications
You must be signed in to change notification settings - Fork 668
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
Removing distutils for 3.12 compatibility #2210
Conversation
Thanks @Cyanosite for this pull request. The change looks good to me. CI: https://gitlab.com/coremltools1/coremltools/-/pipelines/1288882002 |
I'm getting the test pipelines to run locally so you don't have to test my PR every time I submit changes. Alternatively I could work on that in a separate PR and just test with 3.10 for now |
The test pipeline isn't going to work with Python 3.12. We'll need to update all of our test dependencies to version that support Python 3.12. I recommend you stick with 3.10 for this pull request. |
I cannot figure out why the pipeline doesn't work locally, seems to be the same error as in the pipeline on gitlab. |
I fixed the remaining importerrors reported in the pipeline, should be good now.
This might be something to do with dependencies on my side rather than the pull request. It might run fine on the pipeline. |
Distutils has been deprecated in 3.10 and removed in 3.12 (https://docs.python.org/3.10/whatsnew/3.10.html#distutils-deprecated)
For 3.12 compatibility (#2129) I'm proposing to remove distutils.
distutils was only used for its StrictVersion class, this can be replaced by packaging's Version class in every instance, as this library is already a dependency this requires no further packages to be added as dependency.
For the use of the Version class, see: https://packaging.pypa.io/en/latest/version.html