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

the next release (pyflakes 3.0.0) #740

Closed
asottile opened this issue Nov 21, 2022 · 5 comments
Closed

the next release (pyflakes 3.0.0) #740

asottile opened this issue Nov 21, 2022 · 5 comments

Comments

@asottile
Copy link
Member

I'm planning to make a new release in the 3 related projects (pyflakes, pycodestyle, flake8) -- mostly to get some major changes in flake8 out

this will be a major bump here due to removing of # type: ... comment parsing

@asottile asottile pinned this issue Nov 21, 2022
@asottile
Copy link
Member Author

I've run my usually regression analysis -- only a few things come up but all of them are intentional (due to # type: comments):

diff -ur out_baseline/numpy.log out_main/numpy.log
--- out_baseline/numpy.log	2022-11-21 13:11:52.351877534 -0500
+++ out_main/numpy.log	2022-11-21 13:12:34.043878508 -0500
@@ -1089,6 +1089,7 @@
 ./numpy/typing/mypy_plugin.py:42:5: 'mypy.types' imported but unused
 ./numpy/typing/tests/data/pass/array_constructors.py:1:1: 'sys' imported but unused
 ./numpy/typing/tests/data/pass/scalars.py:1:1: 'sys' imported but unused
+./numpy/typing/tests/data/pass/simple.py:5:1: 'collections.abc.Iterable' imported but unused
 ./setup.py:67:1: 'numpy.distutils.command.sdist' imported but unused
 ./tools/changelog.py:37:1: 'sys' imported but unused
 ./tools/cythonize.py:178:9: local variable 'in_file' is assigned to but never used
diff -ur out_baseline/pre-commit.com.log out_main/pre-commit.com.log
--- out_baseline/pre-commit.com.log	2022-11-21 13:11:30.895877033 -0500
+++ out_main/pre-commit.com.log	2022-11-21 13:12:25.207878302 -0500
@@ -0,0 +1 @@
+./install-local.py:24:5: 'typing.Generator' imported but unused
diff -ur out_baseline/t.log out_main/t.log
--- out_baseline/t.log	2022-11-21 13:11:30.287877019 -0500
+++ out_main/t.log	2022-11-21 13:12:24.795878292 -0500
@@ -0,0 +1 @@
+./2019-07-08-mypy-lateinit/t.py:1:1: 'typing.Optional' imported but unused

@asottile
Copy link
Member Author

all done!

@SamuilDichev
Copy link

Remove handling of python 2.x type: comments. Use annotations instead

Could you explain the reasoning behind this? Is there something I can read that you could point me to?

@elParaguayo
Copy link

I'm also interested in this. Type comments were part of PEP484 and, as far as I'm aware, weren't specifically linked to python 2.x usage (https://peps.python.org/pep-0484/#type-comments).

I'd need to go back to our codebase and check again but I think we had some scenarios where annotations didn't work and we needed to use type comments instead.

We could just use a # noqa to suppress the error but that feels a bit messy!

@asottile
Copy link
Member Author

@SamuilDichev pyflakes is python 3+ only, where type comments are obsolete for type annotations -- there's plans to deprecate them everywhere eventually: https://mail.python.org/archives/list/typing-sig@python.org/thread/66JDHQ2I3U3CPUIYA43W7SPEJLLPUETG/

@PyCQA PyCQA locked as off-topic and limited conversation to collaborators Nov 24, 2022
kaste referenced this issue in timbrel/GitSavvy Nov 25, 2022
Beginning with version 6 flake8 (or its shipped pyflakes@3) type
comments aren't supported anymore.

We need to pin the version here because python3.3 doesn't support
type annotations in all places anyhow.  (Let alone we can't replace
them quickly.)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants