forked from ARMmbed/mbed-os
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Bring python packages into the mbed-os source #192
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…nstalled separately
multiplemonomials
changed the title
[draft] Bring python packages into the mbed-os source
Bring python packages into the mbed-os source
Oct 8, 2023
JohnK1987
approved these changes
Oct 9, 2023
@multiplemonomials step 5 of New Project Setup Guide is still right?
BTW this is funny
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 of changes
One python package root to rule them all, one root to find them, one root to bring them all, and in the repository bind them
Up until now, Mbed CE has relied on the user installing the
mbed_tools
python package to their python interpreter before using the build system. This python package is responsible for scanning the source tree and processing all the json files, and then computing a list of target labels and compile definitions for CMake to use. Originally it was also a wrapper around CMake, but that isn't used by Mbed CE. So, this package is needed in order to configure projects, but unlike mainline Mbed it isn't used to wrap the entire build process, and there's no actual requirement that it be installed globally, and it's a bit awkward that we depend on this package that we can't modify or control.Meanwhile, new Linux distro releases such as Ubuntu 22.04 have almost completely blocked the use of Pip to install packages to the global python interpreter (even if you install them to your user directory!). You have to install the packages via apt-get, or you have to use a venv. There are basically no other options. Normally we could just switch to installing the dependencies via apt-get, except that mbed_tools (and the other python package, mbed_os_tools) is not in the apt-get package index. So, if we continue to depend on these system python packages, we would have to require users to create and use venvs, which seems like a pain.
To resolve this, and to lay a path for Mbed CE to make our own changes to these python packages (since they can't be modified without ARM approval), this PR brings the mbed_tools and mbed_os_tools packages into the Mbed CE source tree. I have hooked up their respective test suites, so that all the tests get run and checked when CI builds are made.
Additionally, I set up new requirements files (requirements.apt.txt) so that apt-get can use them. This should make it so that people using Mbed on recent Ubuntu can just install everything with a single command without worrying about venvs or changing pip/python config settings.
Impact of changes
tools/python
tools/requirements.txt
, Debian users should runxargs sudo apt-get install < tools/requirements.apt.txt
Migration actions required
None
Documentation
I have updated the project setup guides to mention the new apt-get method
Pull request type
Test results
Reviewers