-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Remove distutils for newer python versions #15517
base: master
Are you sure you want to change the base?
Conversation
There's build error:
Please review |
fc13050
to
f7317cc
Compare
Shit, I Just recognize, the mbed Tools are Frozen since 6.2, so I cant modify them. That means, this PR never can be merged, right? |
Tools are not maintained anymore unfortunately. If this is not something critical, I would leave it as it is. |
I thought so too, but on the other hand the question should be asked whether Python 3.7 is still a suitable version for testing and building. After all, there have been no more security updates for Python 3.7 since July 2023. Not switching to a newer Python version might be critical enough. |
Due to PEP 632 distutils is deprecated in Python3.10 and Python3.11 and is removed with Python3.12
f7317cc
to
25d126f
Compare
For upgrading tests with matrix of all python versions (https://github.com/tobiasjaster/mbed-os/actions/runs/9439299286) first PR on mbed-os-tools (ARMmbed/mbed-os-tools#290) needs to be merged! |
Due to PEP 632 distutils is deprecated in Python3.10 and Python3.11 and is removed with Python3.12
Summary of changes
Added import switches between older python version (<3.10) and newer python version for downward compatibility
distutils.spawn.find_executable will be replaced by shutil.which
distutils.version.LooseVersion will be replaced by packaging.version.Version
affected files:
tools/toolchains/mbed_toolchain.py
tools/toolchains/arm.py
tools/toolchains/gcc.py
tools/toolchains/iar.py
Impact of changes
For python versions < 3.9 nothing should change, for the newer versions the "Version" of the packaging module could possibly throw errors that were previously accepted.
Migration actions required
Documentation
None
Pull request type
Test results
Reviewers