Skip to content
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

Merged

Conversation

r7vme
Copy link
Contributor

@r7vme r7vme commented Jul 26, 2024

Based on #1709

This PR not for merge, but to be pulled by #1709

Signed-off-by: Roman Sokolkov <[email protected]>
Signed-off-by: Roman Sokolkov <[email protected]>
Comment on lines +20 to +21
# Older Ubuntu
# sudo pip3 install -U --break-system-packages mypy==1.9
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MichaelOrlov

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)

Copy link
Contributor

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.

Copy link
Contributor

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

@MichaelOrlov MichaelOrlov marked this pull request as ready for review August 9, 2024 16:48
@MichaelOrlov MichaelOrlov requested a review from a team as a code owner August 9, 2024 16:48
@MichaelOrlov MichaelOrlov requested review from MichaelOrlov and hidmic and removed request for a team August 9, 2024 16:48
@MichaelOrlov MichaelOrlov merged commit de1b452 into ros2:morlov/update_ci_scripts Aug 9, 2024
10 of 11 checks passed
MichaelOrlov pushed a commit that referenced this pull request Aug 9, 2024
* 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]>
MichaelOrlov added a commit that referenced this pull request Aug 9, 2024
… 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]>
mergify bot pushed a commit that referenced this pull request Aug 9, 2024
… 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)
@r7vme r7vme deleted the morlov/update_ci_scripts branch August 9, 2024 20:07
MichaelOrlov added a commit that referenced this pull request Aug 9, 2024
… 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants