Repository navigation
Redo how we install pip packaging. - #764
Merged
Merged
Conversation
The current way we install packages in __main__ is really a mess. Some of the packages have pinned versions, some do not. Some of the packages are installed only if they are not installed by the underlying OS, some are not. This commit partially cleans this up. In particular, for all pip packages that are *not* colcon-related, we have a tuple which contains the package name, the import name, and the (optional) version we want installed. For every pip package name, we see if we can import it (using the import name); if we can, then we don't need to install it and we skip it. If we *do* need to install it, then we add it to the list and add the version to the constraints. This should mean that this code works on all of Ubuntu, RHEL, and Windows. On Ubuntu and RHEL, almost all packages are installed via the Dockerfiles (the one exception being colcon). For Windows, almost nothing is installed by the chef scripts, so most things will be installed here. A further cleanup here would to also install colcon from packages rather than pip, but this is large enough as it is. If this is acceptable, we can do that in a followup. Along with some other fixes, this change allows us to actually launch an Ubuntu 24.04 job (it still won't pass tests, but that is due to code-related reasons which we are fixing separately). Signed-off-by: Chris Lalancette <[email protected]>
Contributor
Author
nuclearsandwich
approved these changes
Mar 25, 2024
nuclearsandwich
left a comment
Member
There was a problem hiding this comment.
Thanks for splitting this out. I've got an inline comment or two but none are blocking.
clalancette
force-pushed
the
clalancette/redo-pip-packages
branch
from
March 26, 2024 16:40
2e6847d to
77d5a45
Compare
That is, even if we aren't going to install a package (since it was already installed), make sure to add the the number to the constraints file so that other installations won't upgrade it. While we are here, print out the constraints in use for debugging further down the line. Signed-off-by: Chris Lalancette <[email protected]>
clalancette
force-pushed
the
clalancette/redo-pip-packages
branch
from
March 26, 2024 17:20
2ce1dd9 to
156121c
Compare
Contributor
Author
Signed-off-by: Chris Lalancette <[email protected]>
Signed-off-by: Chris Lalancette <[email protected]>
Contributor
Author
cottsay
approved these changes
Mar 27, 2024
Co-authored-by: Scott K Logan <[email protected]> Signed-off-by: Chris Lalancette <[email protected]>
Contributor
Author
Contributor
Author
|
OK. There are more failures on Windows Debug than I would like, but it has also been broken for about a week so I'm not super surprised. The remaining failures mostly seem to revolve around timeouts in cpplint/cppcheck, which we can probably increase the timeouts for. None of it seems connected with the change in Python packages here. So in order to make progress on switching to Noble, I'm going to merge this one in; we'll work on improving Windows Debug in the next few weeks. Thank you to everyone for the reviews. |
This file contains hidden or 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
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.
The current way we install packages in main is really a mess. Some of the packages have pinned versions, some do not. Some of the packages are installed only if they are not installed by the underlying OS, some are not.
This commit partially cleans this up. In particular, for all pip packages that are not colcon-related, we have a tuple which contains the package name, the import name, and the (optional) version we want installed. For every pip package name, we see if we can import it (using the import name); if we can, then we don't need to install it and we skip it. If we do need to install it, then we add it to the list and add the version to the constraints.
This should mean that this code works on all of Ubuntu, RHEL, and Windows. On Ubuntu and RHEL, almost all packages are installed via the Dockerfiles (the one exception being colcon). For Windows, almost nothing is installed by the chef scripts, so most things will be installed here.
A further cleanup here would to also install colcon from packages rather than pip, but this is large enough as it is. If this is acceptable, we can do that in a followup.
Along with some other fixes, this change allows us to actually launch an Ubuntu 24.04 job (it still won't pass tests, but that is due to code-related reasons which we are fixing separately).
While this can be merged independently, in order for Ubuntu 24.04 to work we also need to merge in #762 and #763