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

flake8: DeprecationWarning: SelectableGroups dict interface is deprec… #868

Merged
merged 4 commits into from
Nov 3, 2023

Conversation

fujitatomoya
Copy link
Collaborator

…ated.

address #867

…ated.

  Ref: #867

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Copy link
Collaborator Author

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

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

since we cannot control flake8 implementation, this suppresses the warning in our test code. this makes all package test green.

root@tomoyafujita:~/ros2_ws/colcon_ws# colcon test --event-handlers console_direct+ --packages-select ros2component
Starting >>> ros2component
============================= test session starts ==============================
platform linux -- Python 3.10.12, pytest-6.2.5, py-1.10.0, pluggy-0.13.0
cachedir: /root/ros2_ws/colcon_ws/build/ros2component/.pytest_cache
rootdir: /root/ros2_ws/colcon_ws/src/ros2/ros2cli, configfile: pytest.ini
plugins: ament-xmllint-0.16.0, ament-copyright-0.16.0, ament-pep257-0.16.0, ament-flake8-0.16.0, ament-lint-0.16.0, rerunfailures-10.2, cov-3.0.0, mock-3.6.1, repeat-0.9.1, colcon-core-0.15.0, timeout-2.1.0
timeout: 900.0s
timeout method: thread
timeout func_only: False
collecting ...                              
collected 6 items                                                              

test/test_api.py ..                                                      [ 33%]
test/test_copyright.py .                                                 [ 50%]
test/test_flake8.py .                                                    [ 66%]
test/test_pep257.py .                                                    [ 83%]
test/test_xmllint.py .                                                   [100%]

-- generated xml file: /root/ros2_ws/colcon_ws/build/ros2component/pytest.xml --
============================== 6 passed in 1.54s ===============================
Finished <<< ros2component [2.24s]          

Summary: 1 package finished [3.12s]

@fujitatomoya
Copy link
Collaborator Author

CC: @clalancette @iuhilnehc-ynos

@iuhilnehc-ynos
Copy link

iuhilnehc-ynos commented Nov 2, 2023

How about updating the pytest.ini to filter the warning?

diff --git a/pytest.ini b/pytest.ini
index 2fb26a8..9d367c8 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -2,3 +2,5 @@
 junit_family=xunit2
 timeout=900
 timeout_method=thread
+filterwarnings=ignore:SelectableGroups:DeprecationWarning

Copy link

@iuhilnehc-ynos iuhilnehc-ynos left a comment

Choose a reason for hiding this comment

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

I have no idea if the python3-flake8 in the jammy will remove the warning or not.
(Maybe it's the deprecation cycle for the jammy, and the warning will be removed in the latter Ubuntu distribution.)

This PR will fix the warning issue, so I'd like to aprrove it.

ros2pkg/ros2pkg/resource/ament_python/test_flake8.py.em Outdated Show resolved Hide resolved
@clalancette
Copy link
Contributor

I have no idea if the python3-flake8 in the jammy will remove the warning or not.

I suspect not. It's been there for 2 years, so I don't think that it is going to be fixed in Ubuntu until 24.04.

@clalancette
Copy link
Contributor

How about updating the pytest.ini to filter the warning?

I think we should try doing this to see if it works. That will just make it easier to remove the filter for Ubuntu 24.04.

fujitatomoya and others added 2 commits November 2, 2023 17:26
…s deprecated."

This reverts commit c22551f.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Co-authored-by: Chen Lihui <lihui.chen@sony.com>
@fujitatomoya
Copy link
Collaborator Author

@iuhilnehc-ynos @clalancette pytest.ini just does the magic. requesting approval.

Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

Overall I like this approach. I left one thing to fix inline.

pytest.ini Show resolved Hide resolved
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
@fujitatomoya
Copy link
Collaborator Author

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@fujitatomoya fujitatomoya merged commit 9c13edc into rolling Nov 3, 2023
3 checks passed
@delete-merged-branch delete-merged-branch bot deleted the fujitatomoya/ros2cli-issue-867 branch November 3, 2023 19:16
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.

3 participants