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

Fix compatibility with flake8 version 5 #410

Merged
merged 3 commits into from
Jun 7, 2023

Conversation

roehling
Copy link
Contributor

The ConfigFileFinder class no longer exists in flake8 version 5. The get_style_guide() code has been updated from the latest api.legacy.get_style_guide() in flake8.

@mikepurvis
Copy link

This patch fixes the issues for us on flake8 5.0.4 from nixpkgs. 👍

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.

This looks reasonable to me. I'll run CI on it next.

The ConfigFileFinder class no longer exists in flake8 version 5.
The get_style_guide() code has been updated from the latest
api.legacy.get_style_guide() in flake8.

Signed-off-by: Timo Röhling <roehling@debian.org>
Signed-off-by: Timo Röhling <roehling@debian.org>
@clalancette
Copy link
Contributor

CI:

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

@clalancette clalancette linked an issue Jun 6, 2023 that may be closed by this pull request
Signed-off-by: Chris Lalancette <clalancette@gmail.com>
@clalancette
Copy link
Contributor

New CI after fixing flake8 warnings:

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

@clalancette
Copy link
Contributor

The aarch64 warning is a known flake, so this looks good. I'll go ahead and merge it.

@clalancette clalancette merged commit 6adf864 into ament:rolling Jun 7, 2023
3 checks passed
@roehling roehling deleted the flake8-5 branch June 7, 2023 13:07
emersonknapp pushed a commit to emersonknapp/ament_lint that referenced this pull request Sep 5, 2023
This is a backport of ament#410 to Humble.
When building on Ubuntu 20.04 Focal (Tier 3 support) and following the instructions in https://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Development-Setup.html#install-development-tools-and-ros-tools for that platform, `flake8` is installed via `pip` and so is installed at the newer version 5.
`ament_lint` then fails to run with:

```
/opt/ros/humble/install/lib/python3.8/site-packages/ament_flake8/main.py:150: in get_flake8_style_guide
    config_finder = config.ConfigFileFinder(
E   AttributeError: module 'flake8.options.config' has no attribute 'ConfigFileFinder'
```

This PR fixes that issue.

* Fix compatibility with flake8 version 5

The ConfigFileFinder class no longer exists in flake8 version 5.
The get_style_guide() code has been updated from the latest
api.legacy.get_style_guide() in flake8.

Signed-off-by: Timo Röhling <roehling@debian.org>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
emersonknapp pushed a commit to emersonknapp/ament_lint that referenced this pull request Sep 5, 2023
This is a backport of ament#410 to Humble.
When building on Ubuntu 20.04 Focal (Tier 3 support) and following the instructions in https://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Development-Setup.html#install-development-tools-and-ros-tools for that platform, `flake8` is installed via `pip` and so is installed at the newer version 5.
`ament_lint` then fails to run with:

```
/opt/ros/humble/install/lib/python3.8/site-packages/ament_flake8/main.py:150: in get_flake8_style_guide
    config_finder = config.ConfigFileFinder(
E   AttributeError: module 'flake8.options.config' has no attribute 'ConfigFileFinder'
```

This PR fixes that issue.

* Fix compatibility with flake8 version 5

The ConfigFileFinder class no longer exists in flake8 version 5.
The get_style_guide() code has been updated from the latest
api.legacy.get_style_guide() in flake8.

Signed-off-by: Timo Röhling <roehling@debian.org>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
emersonknapp pushed a commit to emersonknapp/ament_lint that referenced this pull request Sep 6, 2023
This is a backport of ament#410 to Humble.
When building on Ubuntu 20.04 Focal (Tier 3 support) and following the instructions in https://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Development-Setup.html#install-development-tools-and-ros-tools for that platform, `flake8` is installed via `pip` and so is installed at the newer version 5.
`ament_lint` then fails to run with:

```
/opt/ros/humble/install/lib/python3.8/site-packages/ament_flake8/main.py:150: in get_flake8_style_guide
    config_finder = config.ConfigFileFinder(
E   AttributeError: module 'flake8.options.config' has no attribute 'ConfigFileFinder'
```

This PR fixes that issue.

* Fix compatibility with flake8 version 5

The ConfigFileFinder class no longer exists in flake8 version 5.
The get_style_guide() code has been updated from the latest
api.legacy.get_style_guide() in flake8.

Signed-off-by: Timo Röhling <roehling@debian.org>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
emersonknapp pushed a commit to emersonknapp/ament_lint that referenced this pull request Sep 14, 2023
* Fix compatibility with flake8 version 5

The ConfigFileFinder class no longer exists in flake8 version 5.
The get_style_guide() code has been updated from the latest
api.legacy.get_style_guide() in flake8.

Signed-off-by: Timo Röhling <roehling@debian.org>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
emersonknapp pushed a commit to emersonknapp/ament_lint that referenced this pull request Sep 14, 2023
* Fix compatibility with flake8 version 5

The ConfigFileFinder class no longer exists in flake8 version 5.
The get_style_guide() code has been updated from the latest
api.legacy.get_style_guide() in flake8.

Signed-off-by: Timo Röhling <roehling@debian.org>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
clalancette added a commit that referenced this pull request Sep 20, 2023
#451)

* Fix exclude regression (#387)

* Fix compatibility with flake8 version 5 (#410)

* Fix compatibility with flake8 version 5

The ConfigFileFinder class no longer exists in flake8 version 5.
The get_style_guide() code has been updated from the latest
api.legacy.get_style_guide() in flake8.

Signed-off-by: Timo Röhling <roehling@debian.org>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Co-authored-by: methylDragon <methylDragon@gmail.com>
@clalancette
Copy link
Contributor

@Mergifyio backport iron

Copy link

mergify bot commented Dec 20, 2023

backport iron

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Dec 20, 2023
* Fix compatibility with flake8 version 5

The ConfigFileFinder class no longer exists in flake8 version 5.
The get_style_guide() code has been updated from the latest
api.legacy.get_style_guide() in flake8.

Signed-off-by: Timo Röhling <roehling@debian.org>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
(cherry picked from commit 6adf864)
clalancette pushed a commit that referenced this pull request Dec 21, 2023
* Fix compatibility with flake8 version 5

The ConfigFileFinder class no longer exists in flake8 version 5.
The get_style_guide() code has been updated from the latest
api.legacy.get_style_guide() in flake8.

Signed-off-by: Timo Röhling <roehling@debian.org>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
(cherry picked from commit 6adf864)

Co-authored-by: Timo Röhling <timo@gaussglocke.de>
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.

ament_flake8 fails with flake8>=5.0.0
3 participants