Skip to content

Add flake8 B905 to extend-ignore in setup.cfg #4391

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

Merged
merged 2 commits into from
Dec 9, 2022
Merged

Conversation

rwgk
Copy link
Collaborator

@rwgk rwgk commented Dec 9, 2022

Description

I believe (but I'm not actually sure) that the recent flake8 dependabot upgrade from 5.0.4 to 6.0.0, combined with github switching ubuntu-latest from 20.04 to 22.04, is leading to these pre-commit failures:

flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/test_smart_ptr.py:49:17: B905 `zip()` without an explicit `strict=` parameter.
    for i, o in zip(
                ^
tests/test_smart_ptr.py:72:17: B905 `zip()` without an explicit `strict=` parameter.
    for i, o in zip(
                ^
tests/test_stl_binders.py:192:17: B905 `zip()` without an explicit `strict=` parameter.
    assert list(zip(um.keys(), um.values())) == list(um.items())
                ^

This is one of the "Opinionated warnings" and for Python >= 3.10 only:

The strict= argument was added in Python 3.10, so don't enable this flag for code that should work on < 3.10.

I.e. we cannot enable it until we drop 3.9 (https://endoflife.date/python for 3.9 is October 2025).

Suggested changelog entry:

@rwgk rwgk marked this pull request as ready for review December 9, 2022 15:11
@rwgk rwgk requested a review from henryiii as a code owner December 9, 2022 15:11
@rwgk rwgk requested a review from Skylion007 December 9, 2022 15:12
….pre-commit-config.yaml as-is on master.
@rwgk rwgk changed the title Add flake8 --ignore=B905,N818,W503 Add flake8 B905 to extend-ignore in setup.cfg Dec 9, 2022
@rwgk
Copy link
Collaborator Author

rwgk commented Dec 9, 2022

I canceled the CI workflow to not burn so many cycles for a no-op.

@rwgk
Copy link
Collaborator Author

rwgk commented Dec 9, 2022

Thanks Aaron!

@rwgk rwgk merged commit 663b86c into pybind:master Dec 9, 2022
@rwgk rwgk deleted the flake8_B905 branch December 9, 2022 18:53
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Dec 9, 2022
@rwgk rwgk removed the needs changelog Possibly needs a changelog entry label Dec 9, 2022
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