|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2010 - 2022 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Package containg pyflakes adapted for Qt. |
|
8 """ |
|
9 |
|
10 """ License |
|
11 Copyright 2005-2011 Divmod, Inc. |
|
12 Copyright 2013-2014 Florent Xicluna |
|
13 |
|
14 Permission is hereby granted, free of charge, to any person obtaining |
|
15 a copy of this software and associated documentation files (the |
|
16 "Software"), to deal in the Software without restriction, including |
|
17 without limitation the rights to use, copy, modify, merge, publish, |
|
18 distribute, sublicense, and/or sell copies of the Software, and to |
|
19 permit persons to whom the Software is furnished to do so, subject to |
|
20 the following conditions: |
|
21 |
|
22 The above copyright notice and this permission notice shall be |
|
23 included in all copies or substantial portions of the Software. |
|
24 |
|
25 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|
26 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|
27 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
28 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
|
29 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
|
30 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
|
31 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
32 """ |
|
33 |
|
34 __version__ = '2.4.0' |
|
35 |
|
36 """ |
|
37 pyflakes repository date: 2021-10-06. |
|
38 """ |
|
39 |
|
40 """ Changes |
|
41 2.4.0 (2021-10-06) |
|
42 |
|
43 - Remove unused tracing code (``traceTree``) |
|
44 - Add support for ``match`` statement |
|
45 - Detect ``typing`` module attributes when imported with ``import ... as ...`` |
|
46 |
|
47 2.3.1 (2021-03-24) |
|
48 |
|
49 - Fix regression in 2.3.0: type annotations no longer redefine imports |
|
50 |
|
51 2.3.0 (2021-03-14) |
|
52 |
|
53 - Recognize tuple concatenation in ``__all__`` export definitions |
|
54 - Better support use of annotation-only assignments when using |
|
55 ``from __future__ import annotations`` |
|
56 - Recognize special-case typing for ``Annotated`` |
|
57 - Fix undefined name ``__qualname__`` in class scope |
|
58 - Recognize special-cased typing for ``TypeVar`` |
|
59 - Errors for undefined exports in ``__all__`` are shown in a deterministic |
|
60 order |
|
61 - Fix false positives in certain typing constructs (``TypeVar``, |
|
62 ``NamedTuple``, ``TypedDict``, ``cast``) |
|
63 |
|
64 2.2.0 (2020-04-08) |
|
65 |
|
66 - Include column information in error messages |
|
67 - Fix ``@overload`` detection with other decorators and in non-global scopes |
|
68 - Fix return-type annotation being a class member |
|
69 - Fix assignment to ``_`` in doctests with existing ``_`` name |
|
70 - Namespace attributes which are attached to ast nodes with ``_pyflakes_`` to |
|
71 avoid conflicts with other libraries (notably bandit) |
|
72 - Add check for f-strings without placeholders |
|
73 - Add check for unused/extra/invalid ``'string literal'.format(...)`` |
|
74 - Add check for unused/extra/invalid ``'string literal % ...`` |
|
75 - Improve python shebang detection |
|
76 - Allow type ignore to be followed by a code ``# type: ignore[attr-defined]`` |
|
77 - Add support for assignment expressions (PEP 572) |
|
78 - Support ``@overload`` detection from ``typing_extensions`` as well |
|
79 - Fix ``@overload`` detection for async functions |
|
80 - Allow ``continue`` inside ``finally`` in python 3.8+ |
|
81 - Fix handling of annotations in positional-only arguments |
|
82 - Make pyflakes more resistant to future syntax additions |
|
83 - Fix false positives in partially quoted type annotations |
|
84 - Warn about ``is`` comparison to tuples |
|
85 - Fix ``Checker`` usage with async function subtrees |
|
86 - Add check for ``if`` of non-empty tuple |
|
87 - Switch from ``optparse`` to ``argparse`` |
|
88 - Fix false positives in partially quoted type annotations in unusual contexts |
|
89 - Be more cautious when identifying ``Literal`` type expressions |
|
90 |
|
91 2.1.1 (2019-02-28) |
|
92 - Fix reported line number for type comment errors |
|
93 - Fix typing.overload check to only check imported names |
|
94 |
|
95 2.1.0 (2019-01-23) |
|
96 |
|
97 - Allow intentional assignment to variables named ``_`` |
|
98 - Recognize ``__module__`` as a valid name in class scope |
|
99 - ``pyflakes.checker.Checker`` supports checking of partial ``ast`` trees |
|
100 - Detect assign-before-use for local variables which shadow builtin names |
|
101 - Detect invalid ``print`` syntax using ``>>`` operator |
|
102 - Treat ``async for`` the same as a ``for`` loop for introducing variables |
|
103 - Add detection for list concatenation in ``__all__`` |
|
104 - Exempt ``@typing.overload`` from duplicate function declaration |
|
105 - Importing a submodule of an ``as``-aliased ``import``-import is marked as |
|
106 used |
|
107 - Report undefined names from ``__all__`` as possibly coming from a ``*`` |
|
108 import |
|
109 - Add support for changes in Python 3.8-dev |
|
110 - Add support for PEP 563 (``from __future__ import annotations``) |
|
111 - Include Python version and platform information in ``pyflakes --version`` |
|
112 - Recognize ``__annotations__`` as a valid magic global in Python 3.6+ |
|
113 - Mark names used in PEP 484 ``# type: ...`` comments as used |
|
114 - Add check for use of ``is`` operator with ``str``, ``bytes``, and ``int`` |
|
115 literals |
|
116 |
|
117 2.0.0 (2018-05-20) |
|
118 - Drop support for EOL Python <2.7 and 3.2-3.3 |
|
119 - Check for unused exception binding in `except:` block |
|
120 - Handle string literal type annotations |
|
121 - Ignore redefinitions of `_`, unless originally defined by import |
|
122 - Support `__class__` without `self` in Python 3 |
|
123 - Issue an error for `raise NotImplemented(...)` |
|
124 |
|
125 1.6.0 (2017-08-03) |
|
126 - Process function scope variable annotations for used names |
|
127 - Find Python files without extensions by their shebang |
|
128 |
|
129 1.5.0 (2017-01-09) |
|
130 - Enable support for PEP 526 annotated assignments |
|
131 |
|
132 1.4.0 (2016-12-30): |
|
133 - Change formatting of ImportStarMessage to be consistent with other errors |
|
134 - Support PEP 498 "f-strings" |
|
135 |
|
136 1.3.0 (2016-09-01): |
|
137 - Fix PyPy2 Windows IntegrationTests |
|
138 - Check for duplicate dictionary keys |
|
139 - Fix TestMain tests on Windows |
|
140 - Fix "continue" and "break" checks ignoring py3.5's "async for" loop |
|
141 |
|
142 1.2.3 (2016-05-12): |
|
143 - Fix TypeError when processing relative imports |
|
144 |
|
145 1.2.2 (2016-05-06): |
|
146 - Avoid traceback when exception is del-ed in except |
|
147 |
|
148 1.2.1 (2015-05-05): |
|
149 - Fix false RedefinedWhileUnesed for submodule imports |
|
150 |
|
151 1.2.0 (2016-05-03): |
|
152 - Warn against reusing exception names after the except block on Python 3 |
|
153 - Improve the error messages for imports |
|
154 |
|
155 1.1.0 (2016-03-01): |
|
156 - Allow main() to accept arguments. |
|
157 - Support @ matrix-multiplication operator |
|
158 - Validate __future__ imports |
|
159 - Fix doctest scope testing |
|
160 - Warn for tuple assertions which are always true |
|
161 - Warn for "import *" not at module level on Python 3 |
|
162 - Catch many more kinds of SyntaxErrors |
|
163 - Check PEP 498 f-strings |
|
164 - (and a few more sundry bugfixes) |
|
165 |
|
166 1.0.0 (2015-09-20): |
|
167 - Python 3.5 support. async/await statements in particular. |
|
168 - Fix test_api.py on Windows. |
|
169 - Eliminate a false UnusedImport warning when the name has been |
|
170 declared "global" |
|
171 |
|
172 0.9.2 (2015-06-17): |
|
173 - Fix a traceback when a global is defined in one scope, and used in another. |
|
174 |
|
175 0.9.1 (2015-06-09): |
|
176 - Update NEWS.txt to include 0.9.0, which had been forgotten. |
|
177 |
|
178 0.9.0 (2015-05-31): |
|
179 - Exit gracefully, not with a traceback, on SIGINT and SIGPIPE. |
|
180 - Fix incorrect report of undefined name when using lambda expressions in |
|
181 generator expressions. |
|
182 - Don't crash on DOS line endings on Windows and Python 2.6. |
|
183 - Don't report an undefined name if the 'del' which caused a name to become |
|
184 undefined is only conditionally executed. |
|
185 - Properly handle differences in list comprehension scope in Python 3. |
|
186 - Improve handling of edge cases around 'global' defined variables. |
|
187 - Report an error for 'return' outside a function. |
|
188 |
|
189 0.8.1 (2014-03-30): |
|
190 - Detect the declared encoding in Python 3. |
|
191 - Do not report redefinition of import in a local scope, if the |
|
192 global name is used elsewhere in the module. |
|
193 - Catch undefined variable in loop generator when it is also used as |
|
194 loop variable. |
|
195 - Report undefined name for `(a, b) = (1, 2)` but not for the general |
|
196 unpacking `(a, b) = func()`. |
|
197 - Correctly detect when an imported module is used in default arguments |
|
198 of a method, when the method and the module use the same name. |
|
199 - Distribute a universal wheel file. |
|
200 |
|
201 0.8.0 (2014-03-22): |
|
202 - Adapt for the AST in Python 3.4. |
|
203 - Fix caret position on SyntaxError. |
|
204 - Fix crash on Python 2.x with some doctest SyntaxError. |
|
205 - Add tox.ini. |
|
206 - The `PYFLAKES_NODOCTEST` environment variable has been replaced with the |
|
207 `PYFLAKES_DOCTEST` environment variable (with the opposite meaning). |
|
208 Doctest checking is now disabled by default; set the environment variable |
|
209 to enable it. |
|
210 - Correctly parse incremental `__all__ += [...]`. |
|
211 - Catch return with arguments inside a generator (Python <= 3.2). |
|
212 - Do not complain about `_` in doctests. |
|
213 - Drop deprecated methods `pushFunctionScope` and `pushClassScope`. |
|
214 |
|
215 0.7.3 (2013-07-02): |
|
216 - Do not report undefined name for generator expression and dict or |
|
217 set comprehension at class level. |
|
218 - Deprecate `Checker.pushFunctionScope` and `Checker.pushClassScope`: |
|
219 use `Checker.pushScope` instead. |
|
220 - Remove dependency on Unittest2 for the tests. |
|
221 |
|
222 0.7.2 (2013-04-24): |
|
223 - Fix computation of `DoctestSyntaxError.lineno` and `col`. |
|
224 - Add boolean attribute `Checker.withDoctest` to ignore doctests. |
|
225 - If environment variable `PYFLAKES_NODOCTEST` is set, skip doctests. |
|
226 - Environment variable `PYFLAKES_BUILTINS` accepts a comma-separated |
|
227 list of additional built-in names. |
|
228 |
|
229 0.7.1 (2013-04-23): |
|
230 - File `bin/pyflakes` was missing in tarball generated with distribute. |
|
231 - Fix reporting errors in non-ASCII filenames (Python 2.x). |
|
232 |
|
233 0.7.0 (2013-04-17): |
|
234 - Add --version and --help options. |
|
235 - Support `python -m pyflakes` (Python 2.7 and Python 3.x). |
|
236 - Add attribute `Message.col` to report column offset. |
|
237 - Do not report redefinition of variable for a variable used in a list |
|
238 comprehension in a conditional. |
|
239 - Do not report redefinition of variable for generator expressions and |
|
240 set or dict comprehensions. |
|
241 - Do not report undefined name when the code is protected with a |
|
242 `NameError` exception handler. |
|
243 - Do not report redefinition of variable when unassigning a module imported |
|
244 for its side-effect. |
|
245 - Support special locals like `__tracebackhide__` for py.test. |
|
246 - Support checking doctests. |
|
247 - Fix issue with Turkish locale where `'i'.upper() == 'i'` in Python 2. |
|
248 |
|
249 0.6.1 (2013-01-29): |
|
250 - Fix detection of variables in augmented assignments. |
|
251 |
|
252 0.6.0 (2013-01-29): |
|
253 - Support Python 3 up to 3.3, based on the pyflakes3k project. |
|
254 - Preserve compatibility with Python 2.5 and all recent versions of Python. |
|
255 - Support custom reporters in addition to the default Reporter. |
|
256 - Allow function redefinition for modern property construction via |
|
257 property.setter/deleter. |
|
258 - Fix spurious redefinition warnings in conditionals. |
|
259 - Do not report undefined name in __all__ if import * is used. |
|
260 - Add WindowsError as a known built-in name on all platforms. |
|
261 - Support specifying additional built-ins in the `Checker` constructor. |
|
262 - Don't issue Unused Variable warning when using locals() in current scope. |
|
263 - Handle problems with the encoding of source files. |
|
264 - Remove dependency on Twisted for the tests. |
|
265 - Support `python setup.py test` and `python setup.py develop`. |
|
266 - Create script using setuptools `entry_points` to support all platforms, |
|
267 including Windows. |
|
268 |
|
269 0.5.0 (2011-09-02): |
|
270 - Convert pyflakes to use newer _ast infrastructure rather than compiler. |
|
271 - Support for new syntax in 2.7 (including set literals, set comprehensions, |
|
272 and dictionary comprehensions). |
|
273 - Make sure class names don't get bound until after class definition. |
|
274 |
|
275 0.4.0 (2009-11-25): |
|
276 - Fix reporting for certain SyntaxErrors which lack line number |
|
277 information. |
|
278 - Check for syntax errors more rigorously. |
|
279 - Support checking names used with the class decorator syntax in versions |
|
280 of Python which have it. |
|
281 - Detect local variables which are bound but never used. |
|
282 - Handle permission errors when trying to read source files. |
|
283 - Handle problems with the encoding of source files. |
|
284 - Support importing dotted names so as not to incorrectly report them as |
|
285 redefined unused names. |
|
286 - Support all forms of the with statement. |
|
287 - Consider static `__all__` definitions and avoid reporting unused names |
|
288 if the names are listed there. |
|
289 - Fix incorrect checking of class names with respect to the names of their |
|
290 bases in the class statement. |
|
291 - Support the `__path__` global in `__init__.py`. |
|
292 |
|
293 0.3.0 (2009-01-30): |
|
294 - Display more informative SyntaxError messages. |
|
295 - Don't hang flymake with unmatched triple quotes (only report a single |
|
296 line of source for a multiline syntax error). |
|
297 - Recognize __builtins__ as a defined name. |
|
298 - Improve pyflakes support for python versions 2.3-2.5 |
|
299 - Support for if-else expressions and with statements. |
|
300 - Warn instead of error on non-existant file paths. |
|
301 - Check for __future__ imports after other statements. |
|
302 - Add reporting for some types of import shadowing. |
|
303 - Improve reporting of unbound locals |
|
304 """ |