Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-flake8-pyi for
openSUSE:Factory checked in at 2022-12-06 14:24:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-flake8-pyi (Old)
and /work/SRC/openSUSE:Factory/.python-flake8-pyi.new.1835 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-flake8-pyi"
Tue Dec 6 14:24:23 2022 rev:8 rq:1040556 version:22.11.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-flake8-pyi/python-flake8-pyi.changes
2022-11-04 22:00:07.308838558 +0100
+++
/work/SRC/openSUSE:Factory/.python-flake8-pyi.new.1835/python-flake8-pyi.changes
2022-12-06 14:24:41.502300177 +0100
@@ -1,0 +2,13 @@
+Tue Dec 6 03:30:37 UTC 2022 - Yogalakshmi Arunachalam <[email protected]>
+
+- Update to version 22.11.0:
+ * Bugfixes:
+ Specify encoding when opening files. Prevents UnicodeDecodeError on
Windows when the file contains non-CP1252 characters. Contributed by Avasam.
+ Significant changes have been made to the Y041 check. Previously, Y041
flagged "redundant numeric unions"
+ (e.g. float | int, complex | float or complex | int) in all contexts
outside of type aliases. This was incorrect.
+ PEP 484 only specifies that type checkers should treat int as an implicit
subtype of float in the specific context of parameter annotations
+ for functions and methods. Y041 has therefore been revised to only emit
errors on "redundant numeric unions" in the context of parameter annotations.
+ * Other changes:
+ Support running with flake8 v6.
+
+-------------------------------------------------------------------
Old:
----
flake8-pyi-22.10.0.tar.gz
New:
----
flake8-pyi-22.11.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-flake8-pyi.spec ++++++
--- /var/tmp/diff_new_pack.CNVOX9/_old 2022-12-06 14:24:41.950303997 +0100
+++ /var/tmp/diff_new_pack.CNVOX9/_new 2022-12-06 14:24:41.954304031 +0100
@@ -18,7 +18,7 @@
%define skip_python2 1
Name: python-flake8-pyi
-Version: 22.10.0
+Version: 22.11.0
Release: 0
Summary: A plugin for flake8 to enable linting .pyi files
License: MIT
++++++ flake8-pyi-22.10.0.tar.gz -> flake8-pyi-22.11.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/flake8-pyi-22.10.0/CHANGELOG.md
new/flake8-pyi-22.11.0/CHANGELOG.md
--- old/flake8-pyi-22.10.0/CHANGELOG.md 2022-10-07 01:32:16.000000000 +0200
+++ new/flake8-pyi-22.11.0/CHANGELOG.md 2022-11-24 11:57:31.000000000 +0100
@@ -1,5 +1,22 @@
# Change Log
+## 22.11.0
+
+Bugfixes:
+* Specify encoding when opening files. Prevents `UnicodeDecodeError` on Windows
+ when the file contains non-CP1252 characters.
+ Contributed by [Avasam](https://github.com/Avasam).
+* Significant changes have been made to the Y041 check. Previously, Y041
flagged
+ "redundant numeric unions" (e.g. `float | int`, `complex | float` or
`complex | int`)
+ in all contexts outside of type aliases. This was incorrect. PEP 484 only
+ specifies that type checkers should treat `int` as an implicit subtype of
+ `float` in the specific context of parameter annotations for functions and
+ methods. Y041 has therefore been revised to only emit errors on "redundant
+ numeric unions" in the context of parameter annotations.
+
+Other changes:
+* Support running with flake8 v6.
+
## 22.10.0
Bugfixes:
@@ -149,7 +166,7 @@
* extend Y001 to cover `ParamSpec` and `TypeVarTuple` in addition to `TypeVar`
* detect usage of non-integer indices in `sys.version_info` checks
-* extend Y010 to check async functions in addition to normal functions
+* extend Y010 to check async functions in addition to normal functions
* extend Y010 to cover what was previously included in Y090 (disallow
assignments in `__init__` methods) and Y091 (disallow `raise`
statements). The previous checks were disabled by default.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/flake8-pyi-22.10.0/CONTRIBUTING.md
new/flake8-pyi-22.11.0/CONTRIBUTING.md
--- old/flake8-pyi-22.10.0/CONTRIBUTING.md 2022-10-07 01:32:16.000000000
+0200
+++ new/flake8-pyi-22.11.0/CONTRIBUTING.md 2022-11-24 11:57:31.000000000
+0100
@@ -10,6 +10,9 @@
The plugin consists of a single file: `pyi.py`. Tests are run using `pytest`,
and can be
found in the `tests` folder.
+PRs that make user-visible changes should generally add a short description of
the change
+to the `CHANGELOG.md` file in the repository root.
+
## Tests and formatting
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/flake8-pyi-22.10.0/PKG-INFO
new/flake8-pyi-22.11.0/PKG-INFO
--- old/flake8-pyi-22.10.0/PKG-INFO 2022-10-07 01:32:25.514382400 +0200
+++ new/flake8-pyi-22.11.0/PKG-INFO 2022-11-24 11:57:41.639950500 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: flake8-pyi
-Version: 22.10.0
+Version: 22.11.0
Summary: A plugin for flake8 to enable linting .pyi files.
Home-page: https://github.com/ambv/flake8-pyi
Author: Åukasz Langa
@@ -101,7 +101,7 @@
| Y038 | Use `from collections.abc import Set as AbstractSet` instead of `from
typing import AbstractSet`. Like Y027, this error code should be switched off
in your config file if your stubs support Python 2.
| Y039 | Use `str` instead of `typing.Text`. This error code is incompatible
with stubs supporting Python 2.
| Y040 | Never explicitly inherit from `object`, as all classes implicitly
inherit from `object` in Python 3. This error code is incompatible with stubs
supporting Python 2.
-| Y041 | Y041 detects redundant numeric unions. For example, PEP 484 specifies
that type checkers should treat `int` as an implicit subtype of `float`, so
`int` is redundant in the union `int \| float`. In the same way, `int` is
redundant in the union `int \| complex`, and `float` is redundant in the union
`float \| complex`.
+| Y041 | Y041 detects redundant numeric unions in the context of parameter
annotations. For example, PEP 484 specifies that type checkers should allow
`int` objects to be passed to a function, even if the function states that it
accepts a `float`. As such, `int` is redundant in the union `int \| float` in
the context of a parameter annotation. In the same way, `int` is sometimes
redundant in the union `int \| complex`, and `float` is sometimes redundant in
the union `float \| complex`.
| Y042 | Type alias names should use CamelCase rather than snake_case
| Y043 | Do not use names ending in "T" for private type aliases. (The "T"
suffix implies that an object is a `TypeVar`.)
| Y044 | `from __future__ import annotations` has no effect in stub files,
since type checkers automatically treat stubs as having those semantics.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/flake8-pyi-22.10.0/README.md
new/flake8-pyi-22.11.0/README.md
--- old/flake8-pyi-22.10.0/README.md 2022-10-07 01:32:16.000000000 +0200
+++ new/flake8-pyi-22.11.0/README.md 2022-11-24 11:57:31.000000000 +0100
@@ -74,7 +74,7 @@
| Y038 | Use `from collections.abc import Set as AbstractSet` instead of `from
typing import AbstractSet`. Like Y027, this error code should be switched off
in your config file if your stubs support Python 2.
| Y039 | Use `str` instead of `typing.Text`. This error code is incompatible
with stubs supporting Python 2.
| Y040 | Never explicitly inherit from `object`, as all classes implicitly
inherit from `object` in Python 3. This error code is incompatible with stubs
supporting Python 2.
-| Y041 | Y041 detects redundant numeric unions. For example, PEP 484 specifies
that type checkers should treat `int` as an implicit subtype of `float`, so
`int` is redundant in the union `int \| float`. In the same way, `int` is
redundant in the union `int \| complex`, and `float` is redundant in the union
`float \| complex`.
+| Y041 | Y041 detects redundant numeric unions in the context of parameter
annotations. For example, PEP 484 specifies that type checkers should allow
`int` objects to be passed to a function, even if the function states that it
accepts a `float`. As such, `int` is redundant in the union `int \| float` in
the context of a parameter annotation. In the same way, `int` is sometimes
redundant in the union `int \| complex`, and `float` is sometimes redundant in
the union `float \| complex`.
| Y042 | Type alias names should use CamelCase rather than snake_case
| Y043 | Do not use names ending in "T" for private type aliases. (The "T"
suffix implies that an object is a `TypeVar`.)
| Y044 | `from __future__ import annotations` has no effect in stub files,
since type checkers automatically treat stubs as having those semantics.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/flake8-pyi-22.10.0/flake8_pyi.egg-info/PKG-INFO
new/flake8-pyi-22.11.0/flake8_pyi.egg-info/PKG-INFO
--- old/flake8-pyi-22.10.0/flake8_pyi.egg-info/PKG-INFO 2022-10-07
01:32:25.000000000 +0200
+++ new/flake8-pyi-22.11.0/flake8_pyi.egg-info/PKG-INFO 2022-11-24
11:57:41.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: flake8-pyi
-Version: 22.10.0
+Version: 22.11.0
Summary: A plugin for flake8 to enable linting .pyi files.
Home-page: https://github.com/ambv/flake8-pyi
Author: Åukasz Langa
@@ -101,7 +101,7 @@
| Y038 | Use `from collections.abc import Set as AbstractSet` instead of `from
typing import AbstractSet`. Like Y027, this error code should be switched off
in your config file if your stubs support Python 2.
| Y039 | Use `str` instead of `typing.Text`. This error code is incompatible
with stubs supporting Python 2.
| Y040 | Never explicitly inherit from `object`, as all classes implicitly
inherit from `object` in Python 3. This error code is incompatible with stubs
supporting Python 2.
-| Y041 | Y041 detects redundant numeric unions. For example, PEP 484 specifies
that type checkers should treat `int` as an implicit subtype of `float`, so
`int` is redundant in the union `int \| float`. In the same way, `int` is
redundant in the union `int \| complex`, and `float` is redundant in the union
`float \| complex`.
+| Y041 | Y041 detects redundant numeric unions in the context of parameter
annotations. For example, PEP 484 specifies that type checkers should allow
`int` objects to be passed to a function, even if the function states that it
accepts a `float`. As such, `int` is redundant in the union `int \| float` in
the context of a parameter annotation. In the same way, `int` is sometimes
redundant in the union `int \| complex`, and `float` is sometimes redundant in
the union `float \| complex`.
| Y042 | Type alias names should use CamelCase rather than snake_case
| Y043 | Do not use names ending in "T" for private type aliases. (The "T"
suffix implies that an object is a `TypeVar`.)
| Y044 | `from __future__ import annotations` has no effect in stub files,
since type checkers automatically treat stubs as having those semantics.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/flake8-pyi-22.10.0/flake8_pyi.egg-info/requires.txt
new/flake8-pyi-22.11.0/flake8_pyi.egg-info/requires.txt
--- old/flake8-pyi-22.10.0/flake8_pyi.egg-info/requires.txt 2022-10-07
01:32:25.000000000 +0200
+++ new/flake8-pyi-22.11.0/flake8_pyi.egg-info/requires.txt 2022-11-24
11:57:41.000000000 +0100
@@ -1,4 +1,4 @@
-flake8<6.0.0,>=3.2.1
+flake8<7.0.0,>=3.2.1
pyflakes>=2.1.1
[:python_version < "3.9"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/flake8-pyi-22.10.0/pyi.py
new/flake8-pyi-22.11.0/pyi.py
--- old/flake8-pyi-22.10.0/pyi.py 2022-10-07 01:32:16.000000000 +0200
+++ new/flake8-pyi-22.11.0/pyi.py 2022-11-24 11:57:31.000000000 +0100
@@ -39,7 +39,7 @@
# and mypy thinks typing_extensions is part of the stdlib.
from typing_extensions import Literal, TypeAlias, TypeGuard
-__version__ = "22.10.0"
+__version__ = "22.11.0"
LOG = logging.getLogger("flake8.pyi")
FLAKE8_MAJOR_VERSION = flake8.__version_info__[0]
@@ -730,7 +730,7 @@
self.string_literals_allowed = NestingCounter()
self.in_function = NestingCounter()
self.in_class = NestingCounter()
- self.visiting_TypeAlias = NestingCounter()
+ self.visiting_arg = NestingCounter()
# This is only relevant for visiting classes
self.current_class_node: ast.ClassDef | None = None
@@ -1063,8 +1063,7 @@
_Y043_REGEX = re.compile(r"^_.*[a-z]T\d?$")
def _check_typealias(self, node: ast.AnnAssign, alias_name: str) -> None:
- with self.visiting_TypeAlias.enabled():
- self.generic_visit(node)
+ self.generic_visit(node)
if alias_name.startswith("_"):
self.typealias_decls[alias_name] = node
if self._Y042_REGEX.match(alias_name):
@@ -1110,7 +1109,7 @@
self._check_for_Y051_violations(analysis)
if analysis.multiple_literals_in_union:
self._error_for_multiple_literals_in_union(first_union_member,
analysis)
- if not self.visiting_TypeAlias.active:
+ if self.visiting_arg.active:
self._check_for_redundant_numeric_unions(first_union_member,
analysis)
def _check_for_Y051_violations(self, analysis: UnionAnalysis) -> None:
@@ -1715,7 +1714,8 @@
def visit_arg(self, node: ast.arg) -> None:
if _is_NoReturn(node.annotation):
self.error(node, Y050)
- self.generic_visit(node)
+ with self.visiting_arg.enabled():
+ self.generic_visit(node)
def visit_arguments(self, node: ast.arguments) -> None:
self.generic_visit(node)
@@ -1774,7 +1774,7 @@
def _check_for_type_comments(path: Path) -> Iterator[Error]:
- stublines = path.read_text().splitlines()
+ stublines = path.read_text(encoding="UTF-8").splitlines()
for lineno, line in enumerate(stublines, start=1):
cleaned_line = line.strip()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/flake8-pyi-22.10.0/setup.py
new/flake8-pyi-22.11.0/setup.py
--- old/flake8-pyi-22.10.0/setup.py 2022-10-07 01:32:16.000000000 +0200
+++ new/flake8-pyi-22.11.0/setup.py 2022-11-24 11:57:31.000000000 +0100
@@ -11,14 +11,14 @@
current_dir = os.path.abspath(os.path.dirname(__file__))
-with open(os.path.join(current_dir, "README.md"), encoding="utf8") as ld_file:
+with open(os.path.join(current_dir, "README.md"), encoding="UTF-8") as ld_file:
long_description = ld_file.read()
_version_re = re.compile(r"__version__\s+=\s+(?P<version>.*)")
-with open(os.path.join(current_dir, "pyi.py"), "r") as f:
+with open(os.path.join(current_dir, "pyi.py"), "r", encoding="UTF-8") as f:
version = _version_re.search(f.read()).group("version")
version = str(ast.literal_eval(version))
@@ -38,7 +38,7 @@
zip_safe=False,
python_requires=">=3.7",
install_requires=[
- "flake8 >= 3.2.1, < 6.0.0",
+ "flake8 >= 3.2.1, < 7.0.0",
"pyflakes >= 2.1.1",
'ast-decompiler >= 0.7.0, < 1.0; python_version < "3.9"',
],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/flake8-pyi-22.10.0/tests/test_pyi_files.py
new/flake8-pyi-22.11.0/tests/test_pyi_files.py
--- old/flake8-pyi-22.10.0/tests/test_pyi_files.py 2022-10-07
01:32:16.000000000 +0200
+++ new/flake8-pyi-22.11.0/tests/test_pyi_files.py 2022-11-24
11:57:31.000000000 +0100
@@ -12,7 +12,7 @@
flags = []
expected_output = ""
- with open(path) as file:
+ with open(path, encoding="UTF-8") as file:
file_contents = file.read()
for lineno, line in enumerate(file_contents.splitlines(), start=1):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/flake8-pyi-22.10.0/tests/union_duplicates.pyi
new/flake8-pyi-22.11.0/tests/union_duplicates.pyi
--- old/flake8-pyi-22.10.0/tests/union_duplicates.pyi 2022-10-07
01:32:16.000000000 +0200
+++ new/flake8-pyi-22.11.0/tests/union_duplicates.pyi 2022-11-24
11:57:31.000000000 +0100
@@ -25,19 +25,19 @@
_mixed_pipe_union: TypeAlias = Union[Literal[966], bytes, Literal['baz']] #
Y042 Type aliases should use the CamelCase naming convention # Y047 Type alias
"_mixed_pipe_union" is not used # Y030 Multiple Literal members in a union.
Combine them into one, e.g. "Literal[966, 'baz']".
ManyLiteralMembersButNeedsCombining: TypeAlias = int | Literal['a', 'b'] |
Literal['baz'] # Y030 Multiple Literal members in a union. Combine them into
one, e.g. "Literal['a', 'b', 'baz']".
-a: int | float # Y041 Use "float" instead of "int | float" (see "The numeric
tower" in PEP 484)
-b: Union[builtins.float, str, bytes, builtins.int] # Y041 Use "float" instead
of "int | float" (see "The numeric tower" in PEP 484)
+a: int | float # No error here, Y041 only applies to argument annotations
+b: Union[builtins.float, str, bytes, builtins.int] # No error here, Y041 only
applies to argument annotations
def func(arg: float | list[str] | type[bool] | complex) -> None: ... # Y041
Use "complex" instead of "float | complex" (see "The numeric tower" in PEP 484)
class Foo:
def method(self, arg: int | builtins.float | complex) -> None: ... # Y041
Use "complex" instead of "float | complex" (see "The numeric tower" in PEP 484)
# Y041 Use "complex" instead of "int | complex" (see "The numeric tower" in
PEP 484)
-c: Union[builtins.complex, memoryview, slice, int] # Y041 Use "complex"
instead of "int | complex" (see "The numeric tower" in PEP 484)
+c: Union[builtins.complex, memoryview, slice, int] # No error here, Y041 only
applies to argument annotations
# Don't error with Y041 here, the two error messages combined are quite
confusing
-d: int | int | float # Y016 Duplicate union member "int"
+def foo(d: int | int | float) -> None: ... # Y016 Duplicate union member "int"
-f: Literal["foo"] | Literal["bar"] | int | float | builtins.bool # Y030
Multiple Literal members in a union. Combine them into one, e.g.
"Literal['foo', 'bar']". # Y041 Use "float" instead of "int | float" (see "The
numeric tower" in PEP 484)
+def bar(f: Literal["foo"] | Literal["bar"] | int | float | builtins.bool) ->
None: ... # Y030 Multiple Literal members in a union. Combine them into one,
e.g. "Literal['foo', 'bar']". # Y041 Use "float" instead of "int | float" (see
"The numeric tower" in PEP 484)
# Type aliases are special-cased to be excluded from Y041
MyTypeAlias: TypeAlias = int | float | bool
@@ -52,5 +52,5 @@
var: builtins.bool | Literal[True] # Y051 "Literal[True]" is redundant in
a union with "bool"
DupesHereSoNoY051: TypeAlias = int | int | Literal[42] # Y016 Duplicate union
member "int"
-NightmareAlias1 = int | float | Literal[4, b"bar"] | Literal["foo"] # Y026
Use typing_extensions.TypeAlias for type aliases, e.g. "NightmareAlias1:
TypeAlias = int | float | Literal[4, b'bar'] | Literal['foo']" # Y030 Multiple
Literal members in a union. Combine them into one, e.g. "Literal[4, b'bar',
'foo']". # Y041 Use "float" instead of "int | float" (see "The numeric tower"
in PEP 484) # Y051 "Literal[4]" is redundant in a union with "int"
+NightmareAlias1 = int | float | Literal[4, b"bar"] | Literal["foo"] # Y026
Use typing_extensions.TypeAlias for type aliases, e.g. "NightmareAlias1:
TypeAlias = int | float | Literal[4, b'bar'] | Literal['foo']" # Y030 Multiple
Literal members in a union. Combine them into one, e.g. "Literal[4, b'bar',
'foo']". # Y051 "Literal[4]" is redundant in a union with "int"
nightmare_alias2: TypeAlias = int | float | Literal[True, 4] | Literal["foo"]
# Y042 Type aliases should use the CamelCase naming convention # Y030 Multiple
Literal members in a union. Combine them into one, e.g. "Literal[True, 4,
'foo']". # Y051 "Literal[4]" is redundant in a union with "int"