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 linting error in src/test_typing_extensions.py #98

Merged
merged 3 commits into from Nov 25, 2022

Conversation

hegjon
Copy link
Contributor

@hegjon hegjon commented Nov 25, 2022

Before

typing_extensions on ξ‚  main via 🐍 v3.10.8 took 2s
❯ ~/.local/bin/flake8 --config=.flake8-tests src/test_typing_extensions.py
src/test_typing_extensions.py:20:1: F401 'typing.Iterator' imported but unused

After

typing_extensions on ξ‚  lint-fix [⇑] via 🐍 v3.10.8
❯ ~/.local/bin/flake8 --config=.flake8-tests src/test_typing_extensions.py

@hegjon hegjon changed the title Removed unused typing.Iterator import Removed unused typing.Iterator import from src/test_typing_extensions.py Nov 25, 2022
@AlexWaygood
Copy link
Member

AlexWaygood commented Nov 25, 2022

Can you convert uses in the file such as the following to PEP 526 syntax? It's not actually an unused import, it's just that flake8 v6 doesn't support type comments anymore:

base_it = range(10) # type: Iterator[int]

You can use https://github.com/ilevkivskyi/com2ann to automate the process.

@hegjon hegjon changed the title Removed unused typing.Iterator import from src/test_typing_extensions.py Fix linting error in src/test_typing_extensions.py Nov 25, 2022
@hegjon
Copy link
Contributor Author

hegjon commented Nov 25, 2022

typing_extensions on ξ‚  lint-fix [⇑] via 🐍 v3.10.8 took 8s
❯ ~/.local/bin/flake8 --config=.flake8-tests src/test_typing_extensions.py

typing_extensions on ξ‚  lint-fix [⇑] via 🐍 v3.10.8
❯ pytest
===================================== test session starts =====================================
platform linux -- Python 3.10.8, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/jonny/projects/typing_extensions
plugins: web3-5.29.0, forked-1.4.0, xdist-2.5.0, cov-4.0.0
collected 263 items

src/test_typing_extensions.py ......................................................... [ 21%]
....................................................................................... [ 54%]
.s................s.................................................................... [ 87%]
...................s.s..s.......                                                        [100%]

=============================== 258 passed, 5 skipped in 2.89s ================================

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM

@srittau srittau merged commit ad3966d into python:main Nov 25, 2022
@hegjon hegjon deleted the lint-fix branch November 25, 2022 17:10
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.

None yet

3 participants