15
0

- Remove LICENSE source, it's now in the release

- Remove python_module macro definition
- Update to 22.10.0:
  # Bugfixes:
  - Do not emit Y020 for empty strings. Y020 concerns "quoted annotations",
  - but an empty string can never be a quoted annotation.
  - Add special-casing so that Y020 is not emitted for __slots__ definitions
  - inside class blocks.
  - Expand Y035 to cover __slots__ definitions as well as __match_args__ and
  - __all__ definitions.
  - Expand Y015 so that errors are emitted for assignments to negative numbers.
  # Other changes:
  - Since v22.8.1, flake8-pyi has emitted a FutureWarning if run with flake8<5,
    warning that the plugin would soon become incompatible with flake8<5. Due
    to some issues that mean that some users are unable to upgrade to
    flake8>=5, however, flake8-pyi no longer intends to remove support for
    running the plugin with flake8<5 before Python 3.7 has reached end-of-life.
    As such, the FutureWarning is no longer emitted.
- 22.8.2:
  # New error codes:
  - Y047: Detect unused TypeAlias declarations.
  - Y049: Detect unused TypedDict definitions.
  - Y050: Prefer typing_extensions.Never for argument annotations over
    typing.NoReturn.
  - Y051: Detect redundant unions between Literal types and builtin supertypes
    (e.g. Literal["foo"] | str, or Literal[5] | int).
  # Other enhancements:
  - Support mypy_extensions.TypedDict.
- 22.8.1:
  - Add support for flake8 >= 5.0.0.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flake8-pyi?expand=0&rev=13
This commit is contained in:
2022-11-04 15:51:21 +00:00
committed by Git OBS Bridge
parent 044c357094
commit 7b92b6e1ec
5 changed files with 163 additions and 31 deletions

21
LICENSE
View File

@@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2016 Łukasz Langa
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cee3b20a5123152c697870e7e800b60e3c95eb89e272a2b63d8cf55cafb0472c
size 12814

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9dff4e126b2657c0b1e1c8c781199310e56fdc38f51669112849a557de3be543
size 41006

View File

@@ -1,3 +1,158 @@
-------------------------------------------------------------------
Fri Nov 4 15:45:00 UTC 2022 - Daniel Garcia <daniel.garcia@suse.com>
- Remove LICENSE source, it's now in the release
- Remove python_module macro definition
- Update to 22.10.0:
# Bugfixes:
- Do not emit Y020 for empty strings. Y020 concerns "quoted annotations",
- but an empty string can never be a quoted annotation.
- Add special-casing so that Y020 is not emitted for __slots__ definitions
- inside class blocks.
- Expand Y035 to cover __slots__ definitions as well as __match_args__ and
- __all__ definitions.
- Expand Y015 so that errors are emitted for assignments to negative numbers.
# Other changes:
- Since v22.8.1, flake8-pyi has emitted a FutureWarning if run with flake8<5,
warning that the plugin would soon become incompatible with flake8<5. Due
to some issues that mean that some users are unable to upgrade to
flake8>=5, however, flake8-pyi no longer intends to remove support for
running the plugin with flake8<5 before Python 3.7 has reached end-of-life.
As such, the FutureWarning is no longer emitted.
- 22.8.2:
# New error codes:
- Y047: Detect unused TypeAlias declarations.
- Y049: Detect unused TypedDict definitions.
- Y050: Prefer typing_extensions.Never for argument annotations over
typing.NoReturn.
- Y051: Detect redundant unions between Literal types and builtin supertypes
(e.g. Literal["foo"] | str, or Literal[5] | int).
# Other enhancements:
- Support mypy_extensions.TypedDict.
- 22.8.1:
- Add support for flake8 >= 5.0.0.
- 22.8.0:
# New error codes:
- Y046: Detect unused Protocols.
- Y048: Function bodies should contain exactly one statement.
# Bugfixes:
- Improve error message for the case where a function body contains a
docstring and a ... or pass statement.
# Other changes:
- Pin required flake8 version to <5.0.0 (flake8-pyi is not currently
compatible with flake8 5.0.0).
- 22.7.0
# New error codes:
- Introduce Y041: Ban redundant numeric unions (int | float, int | complex,
float | complex).
- Introduce Y042: Type alias names should use CamelCase rather than
snake_case
- Introduce Y043: Ban type aliases from having names ending with an uppercase
"T".
- Introduce Y044: Discourage unnecessary from __future__ import annotations
import. Contributed by Torsten Wörtwein.
- Introduce Y045: Ban returning (Async)Iterable from __(a)iter__ methods.
# Other enhancements and behaviour changes:
- Improve error message for Y026 check.
- Expand Y026 check. Since version 22.4.0, this has only emitted an error for
assignments to typing.Literal, typing.Union, and PEP 604 unions. It now
also emits an error for any subscription on the right-hand side of a simple
assignment, as well as for assignments to typing.Any and None.
- Support typing_extensions.overload and typing_extensions.NamedTuple.
- Slightly expand Y034 to cover the case where a class inheriting from
(Async)Iterator returns (Async)Iterable from __(a)iter__. These classes
should nearly always return Self from these methods.
- Support Python 3.11.
- 22.5.1:
# Behaviour changes:
- Relax Y020 check slightly, enabling the idiom __all__ += ["foo", "bar"] to
be used in a stub file.
- 22.5.0:
# Features:
- Introduce Y039: Use str instead of typing.Text for Python 3 stubs.
- Teach the Y036 check that builtins.object (as well as the unqualified
object) is acceptable as an annotation for an __(a)exit__ method argument.
- Teach the Y029 check to emit errors for __repr__ and __str__ methods that
return builtins.str (as opposed to the unqualified str).
- Introduce Y040: Never explicitly inherit from object in Python 3 stubs.
- 22.4.1:
# Features:
- Expand Y027 check to prohibit importing any objects from the typing module
that are aliases for objects living collections.abc (except for
typing.AbstractSet, which is special-cased).
- Introduce Y038: Use from collections.abc import Set as AbstractSet instead
of from typing import AbstractSet.
# Bugfixes:
- Improve inaccurate error messages for Y036.
- 22.4.0:
# Features:
- Introduce Y036 (check for badly defined __exit__ and __aexit__ methods).
- Introduce Y037 (Use PEP 604 syntax instead of typing.Union and
typing.Optional). Contributed by Oleg Höfling.
# Behaviour changes:
- Expand Y035 to cover __match_args__ inside class definitions, as well as
__all__ in the global scope.
# Bugfixes:
- Improve Y026 check (regarding typing.TypeAlias) to reduce false-positive
errors emitted when the plugin encountered variable aliases in a stub file.
- 22.3.0:
# Bugfixes:
- fix bug where incorrect quoted annotations were not detected within if
blocks
# Behaviour changes:
- Add special-casing so that string literals are allowed in the context of
__match_args__ assignments inside a class definition.
- Add special-casing so that arbitrary values can be assigned to a variable
in a stub file if the variable is annotated with Final.
- 22.2.0:
# Bugfixes:
- fix bugs in several error codes so that e.g. _T = typing.TypeVar("_T") is
recognised as a TypeVar definition (previously only _T = TypeVar("_T") was
recognised).
- fix bug where foo = False at the module level did not trigger a Y015 error.
- fix bug where TypeVars were erroneously flagged as unused if they were only
used in a typing.Union subscript.
- improve unclear error messages for Y022, Y023 and Y027 error codes.
# Features:
- introduce Y032 (prefer object to Any for the second argument in __eq__ and
__ne__ methods).
- introduce Y033 (always use annotations in stubs, rather than type
comments).
- introduce Y034 (detect common errors where return types are hardcoded, but
they should use TypeVars instead).
- introduce Y035 (__all__ in a stub has the same semantics as at runtime).
- 22.1.0:
- 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 cover what was previously included in Y090 (disallow
assignments in __init__ methods) and Y091 (disallow raise statements). The
previous checks were disabled by default.
- introduce Y016 (duplicate union member)
- introduce Y017 (disallows assignments with multiple targets or non-name
targets)
- introduce Y018 (detect unused TypeVars)
- introduce Y019 (detect TypeVars that should be _typeshed.Self, but aren't)
- introduce Y020 (never use quoted annotations in stubs)
- introduce Y021 (docstrings should not be included in stubs)
- introduce Y022 (prefer stdlib classes over typing aliases)
- introduce Y023 (prefer typing over typing_extensions)
- introduce Y024 (prefer typing.NamedTuple to collections.namedtuple)
- introduce Y026 (require using TypeAlias for type aliases)
- introduce Y025 (always alias collections.abc.Set)
- introduce Y027 (Python 2-incompatible extension of Y022)
- introduce Y028 (Use class-based syntax for NamedTuples)
- introduce Y029 (never define __repr__ or __str__)
- introduce Y030 (use Literal['foo', 'bar'] instead of Literal['foo'] |
Literal['bar'])
- introduce Y031 (use class-based syntax for TypedDicts where possible)
- all errors are now enabled by default
- remove Y092 (top-level attribute must not have a default value)
- attrs is no longer a dependency
- ast_decompiler has been added as a dependency on Python 3.8 and 3.7
- support Python 3.10
- discontinue support for Python 3.6
-------------------------------------------------------------------
Tue May 4 06:41:27 UTC 2021 - Markéta Machová <mmachova@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-flake8-pyi
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,16 +17,15 @@
%define skip_python2 1
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-flake8-pyi
Version: 20.10.0
Version: 22.10.0
Release: 0
Summary: A plugin for flake8 to enable linting .pyi files
License: MIT
Group: Development/Languages/Python
URL: https://github.com/ambv/flake8-pyi
Source: https://files.pythonhosted.org/packages/source/f/flake8-pyi/flake8-pyi-%{version}.tar.gz
Source1: https://raw.githubusercontent.com/ambv/flake8-pyi/master/LICENSE
BuildRequires: %{python_module ast-decompiler}
BuildRequires: %{python_module base >= 3.6.0}
BuildRequires: %{python_module setuptools}
BuildRequires: python-rpm-macros
@@ -53,9 +52,8 @@ A plugin for Flake8 that provides specializations for type hinting stub
files. Especially interesting for linting typeshed.
%prep
%setup -q -n flake8-pyi-%{version}
%autosetup -p1 -n flake8-pyi-%{version}
sed -i '1{\,^#!%{_bindir}/env python,d}' pyi.py
cp %{SOURCE1} .
%build
%python_build
@@ -69,7 +67,7 @@ cp %{SOURCE1} .
%files %{python_files}
%license LICENSE
%doc README.rst
%doc README.md
%{python_sitelib}/pyi.py*
%{pycache_only %{python_sitelib}/__pycache__/pyi.*.py*}
%{python_sitelib}/flake8_pyi-%{version}-*.egg-info