-
Notifications
You must be signed in to change notification settings - Fork 55
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
Use setuptools instead of distutils for Python > 3.8. #2113
Conversation
I confirm this patch works as expected |
0807fc9
to
c3de464
Compare
@remicollet Thanks for confirming. Wondering how that worked without |
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## main #2113 +/- ##
=======================================
Coverage 83.88% 83.88%
=======================================
Files 161 161
Lines 32249 32249
=======================================
Hits 27052 27052
Misses 5197 5197 ☔ View full report in Codecov by Sentry. |
@@ -78,7 +82,7 @@ def file_text(path, encoding = CONSOLE_ENCODING): | |||
return f.read().decode(encoding).replace('\r\r', '\r') | |||
|
|||
def find_utility(name, exitifnone = True): | |||
path = distutils.spawn.find_executable(name) | |||
path = shutil.which(name) |
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.
Not tested, but setuptools._distutils.spawn
provides distutils.spawn and find_executable.
# head /usr/lib/python3.11/site-packages/setuptools/_distutils/spawn.py
"""distutils.spawn
Provides the 'spawn()' function, a front-end to various platform-
specific functions for launching another program in a sub-process.
Also provides the 'find_executable()' to search the path for a given
executable name.
"""
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.
Thanks. Let's use shutil.which
as it seems to be easier solution. Or do you know any disadvantages?
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.
Yes shutil.which seems the simpler.
LGTM
Tested with various python versions (Fedora, RHEL-8 and 9) using shlib (and removing import of distutils) |
@ni4 other than the comments from @remicollet there is also a failure in Cirrus: https://cirrus-ci.com/task/6093471186944000
|
c3de464
to
76e627c
Compare
Thanks, re-pushed. cli_tests-Encryption occasionally fails due to GnuPG's handling of multiple SKESKs. |
06f9d9b
to
6967bcb
Compare
Ping @antonsviridenko for approval. Thanks! |
@maxirmx Do you have an idea why Windows-2019 OpenSSL runners fail? I added some debug logging, but those doesn't given any idea to me. |
@ni4 It does not look like the issue you mentioned but we have to wait until it is resolved |
|
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.
@ronaldtse I'm not an expert in Python, but otherwise looks good.
microsoft/vcpkg#32600
|
@maxirmx Thanks for the investigation! |
Agree @ni4 , let’s merge first. Thanks! |
Fixes #2112