-
Notifications
You must be signed in to change notification settings - Fork 248
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
Fixes for new mypy (Ubuntu 24.04) #1763
Fixes for new mypy (Ubuntu 24.04) #1763
Conversation
Signed-off-by: Roman Sokolkov <[email protected]>
Signed-off-by: Roman Sokolkov <[email protected]>
# Older Ubuntu | ||
# sudo pip3 install -U --break-system-packages mypy==1.9 |
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.
@r7vme The problem is that on Ubuntu 22.04 the default pip3 version is 22.0.2 and python version is 3.10 and there is no --break-system-packages
option for pip3 install on those versions.
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.
Another aspect of installing via pip3.
What if the user already has an old version of mypy installed with the
sudo apt update && sudo apt install mypy
What version of the mypy will be used? It seems like an undefined behavior that we would like to avoid.
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.
The problem is that on Ubuntu 22.04 the default pip3 version is 22.0.2 and python version is 3.10 and there is no --break-system-packages option for pip3 install on those versions.
My bad, --break-system-packages
should be removed
What version of the mypy will be used? It seems like an undefined behavior that we would like to avoid.
I tested in docker container with ubuntu:jammy and after installing 1.9.0 via pip and 0.942 via apt. I got
root@f647688bc269:/# mypy --version
mypy 1.9.0 (compiled: yes)
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.
@r7vme Ok it works.
Only one concern is about sudo
for pip3 install
command.
It seems we can install mypy without sudo
.
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.
Without sudo mypy installing in the user local folder. e.g. /home/morlov/.local/bin/mypy
de1b452
into
ros2:morlov/update_ci_scripts
* Apply new stubgen changes Signed-off-by: Roman Sokolkov <[email protected]> * Update CI script and README.md Signed-off-by: Roman Sokolkov <[email protected]> --------- Signed-off-by: Roman Sokolkov <[email protected]>
… to latest versions (#1709) * Use Ubuntu Noble distros for ci jobs on rolling Signed-off-by: Michael Orlov <[email protected]> * Bump actions-ros-lint to version 0.1.3 and actions/checkout to v4 Signed-off-by: Michael Orlov <[email protected]> * Exclude cppcheck from CI due to known issue that it is very slow See ament/ament_lint#345 for details. Signed-off-by: Michael Orlov <[email protected]> * Bump mypy to version 1.9.0-4ubuntu1 to be aligned with Noble - Also add `--break-system-packages` to avoid error during pip uninstall Signed-off-by: Michael Orlov <[email protected]> * Remove "sudo pip uninstall -y mypy" since it is not installed with pip Addressing the error message: Found existing installation: mypy 1.9.0 ERROR: Cannot uninstall mypy 1.9.0, RECORD file not found. Hint: The package was installed by debian. Signed-off-by: Michael Orlov <[email protected]> * Revert "Bump mypy to version 1.9.0-4ubuntu1 to be aligned with Noble" This reverts commit b5aa018 Signed-off-by: Michael Orlov <[email protected]> * Fixes for new mypy (Ubuntu 24.04) (#1763) * Apply new stubgen changes Signed-off-by: Roman Sokolkov <[email protected]> * Update CI script and README.md Signed-off-by: Roman Sokolkov <[email protected]> --------- Signed-off-by: Roman Sokolkov <[email protected]> * Remove "--break-system-packages" flag from mypy install in README.md - Rationale: On Ubuntu 22.04 is an older version of the pip3 and python version which doesn't have this flag. - Also removed sudo before "pip3 install -U mypy==1.9" in README.md Signed-off-by: Michael Orlov <[email protected]> --------- Signed-off-by: Michael Orlov <[email protected]> Signed-off-by: Roman Sokolkov <[email protected]> Co-authored-by: Roman <[email protected]>
… to latest versions (#1709) * Use Ubuntu Noble distros for ci jobs on rolling Signed-off-by: Michael Orlov <[email protected]> * Bump actions-ros-lint to version 0.1.3 and actions/checkout to v4 Signed-off-by: Michael Orlov <[email protected]> * Exclude cppcheck from CI due to known issue that it is very slow See ament/ament_lint#345 for details. Signed-off-by: Michael Orlov <[email protected]> * Bump mypy to version 1.9.0-4ubuntu1 to be aligned with Noble - Also add `--break-system-packages` to avoid error during pip uninstall Signed-off-by: Michael Orlov <[email protected]> * Remove "sudo pip uninstall -y mypy" since it is not installed with pip Addressing the error message: Found existing installation: mypy 1.9.0 ERROR: Cannot uninstall mypy 1.9.0, RECORD file not found. Hint: The package was installed by debian. Signed-off-by: Michael Orlov <[email protected]> * Revert "Bump mypy to version 1.9.0-4ubuntu1 to be aligned with Noble" This reverts commit b5aa018 Signed-off-by: Michael Orlov <[email protected]> * Fixes for new mypy (Ubuntu 24.04) (#1763) * Apply new stubgen changes Signed-off-by: Roman Sokolkov <[email protected]> * Update CI script and README.md Signed-off-by: Roman Sokolkov <[email protected]> --------- Signed-off-by: Roman Sokolkov <[email protected]> * Remove "--break-system-packages" flag from mypy install in README.md - Rationale: On Ubuntu 22.04 is an older version of the pip3 and python version which doesn't have this flag. - Also removed sudo before "pip3 install -U mypy==1.9" in README.md Signed-off-by: Michael Orlov <[email protected]> --------- Signed-off-by: Michael Orlov <[email protected]> Signed-off-by: Roman Sokolkov <[email protected]> Co-authored-by: Roman <[email protected]> (cherry picked from commit 27a6b60)
… scripts to latest versions (backport #1709) (#1779) * Update CI scripts to use Ubuntu Noble distros and bump action scripts to latest versions (#1709) * Use Ubuntu Noble distros for ci jobs on rolling Signed-off-by: Michael Orlov <[email protected]> * Bump actions-ros-lint to version 0.1.3 and actions/checkout to v4 Signed-off-by: Michael Orlov <[email protected]> * Exclude cppcheck from CI due to known issue that it is very slow See ament/ament_lint#345 for details. Signed-off-by: Michael Orlov <[email protected]> * Bump mypy to version 1.9.0-4ubuntu1 to be aligned with Noble - Also add `--break-system-packages` to avoid error during pip uninstall Signed-off-by: Michael Orlov <[email protected]> * Remove "sudo pip uninstall -y mypy" since it is not installed with pip Addressing the error message: Found existing installation: mypy 1.9.0 ERROR: Cannot uninstall mypy 1.9.0, RECORD file not found. Hint: The package was installed by debian. Signed-off-by: Michael Orlov <[email protected]> * Revert "Bump mypy to version 1.9.0-4ubuntu1 to be aligned with Noble" This reverts commit b5aa018 Signed-off-by: Michael Orlov <[email protected]> * Fixes for new mypy (Ubuntu 24.04) (#1763) * Apply new stubgen changes Signed-off-by: Roman Sokolkov <[email protected]> * Update CI script and README.md Signed-off-by: Roman Sokolkov <[email protected]> --------- Signed-off-by: Roman Sokolkov <[email protected]> * Remove "--break-system-packages" flag from mypy install in README.md - Rationale: On Ubuntu 22.04 is an older version of the pip3 and python version which doesn't have this flag. - Also removed sudo before "pip3 install -U mypy==1.9" in README.md Signed-off-by: Michael Orlov <[email protected]> --------- Signed-off-by: Michael Orlov <[email protected]> Signed-off-by: Roman Sokolkov <[email protected]> Co-authored-by: Roman <[email protected]> (cherry picked from commit 27a6b60) * Update github CI scripts to use jazzy instead of rolling Signed-off-by: Michael Orlov <[email protected]> --------- Signed-off-by: Michael Orlov <[email protected]> Co-authored-by: Michael Orlov <[email protected]>
Based on #1709
This PR not for merge, but to be pulled by #1709