forked from pool/python-flake8-pyi
Compare commits
5 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| b566e73afe | |||
| 74ca69d076 | |||
| 579fa50bc3 | |||
| 4608eea2b1 | |||
| 94197e409a |
38
fix-tests.patch
Normal file
38
fix-tests.patch
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
From 0197415ebccb6558350822e15f4bb9a0f9b758bb Mon Sep 17 00:00:00 2001
|
||||||
|
From: Sebastian Rittau <srittau@rittau.biz>
|
||||||
|
Date: Sun, 31 Aug 2025 03:56:30 +0200
|
||||||
|
Subject: [PATCH] Fix tests to reflect the current state (#526)
|
||||||
|
|
||||||
|
---
|
||||||
|
tests/forward_refs_annassign.pyi | 4 ++--
|
||||||
|
tests/vanilla_flake8_not_clean_forward_refs.pyi | 4 +++-
|
||||||
|
2 files changed, 5 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/tests/forward_refs_annassign.pyi b/tests/forward_refs_annassign.pyi
|
||||||
|
index 51f94791..41887e4e 100644
|
||||||
|
--- a/tests/forward_refs_annassign.pyi
|
||||||
|
+++ b/tests/forward_refs_annassign.pyi
|
||||||
|
@@ -50,7 +50,7 @@ class Child(Parent): ...
|
||||||
|
|
||||||
|
class MyClass:
|
||||||
|
foo: int
|
||||||
|
- bar = foo
|
||||||
|
+ bar = foo # F821 undefined name 'foo'
|
||||||
|
|
||||||
|
baz: MyClass
|
||||||
|
-eggs = baz
|
||||||
|
+eggs = baz # F821 undefined name 'baz'
|
||||||
|
diff --git a/tests/vanilla_flake8_not_clean_forward_refs.pyi b/tests/vanilla_flake8_not_clean_forward_refs.pyi
|
||||||
|
index 98ec183f..6c9d5208 100644
|
||||||
|
--- a/tests/vanilla_flake8_not_clean_forward_refs.pyi
|
||||||
|
+++ b/tests/vanilla_flake8_not_clean_forward_refs.pyi
|
||||||
|
@@ -3,6 +3,8 @@ from typing import TypeAlias, Union
|
||||||
|
|
||||||
|
ManyStr: TypeAlias = list[EitherStr] # F821 undefined name 'EitherStr'
|
||||||
|
EitherStr: TypeAlias = Union[str, bytes]
|
||||||
|
-def function(accepts: EitherStr) -> None: ...
|
||||||
|
+# The following line reports "F821 undefined name 'EitherStr'" on Python 3.14+
|
||||||
|
+# but not on earlier versions.
|
||||||
|
+# def function(accepts: EitherStr) -> None: ... # F821 undefined name 'EitherStr'
|
||||||
|
|
||||||
|
del EitherStr # private name, not exported
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:74847fe88dba8dc3ccd27091dc5dcbe8993d7616214e4084f33afe469a675b14
|
|
||||||
size 61912
|
|
||||||
3
flake8_pyi-25.5.0.tar.gz
Normal file
3
flake8_pyi-25.5.0.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:dde18e5b20e6e17433767db97960164a4b4bbe0814a174a9e5ac552d8c73982a
|
||||||
|
size 63225
|
||||||
@@ -1,3 +1,30 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Sep 5 15:02:05 UTC 2025 - Markéta Machová <mmachova@suse.com>
|
||||||
|
|
||||||
|
- update to 25.5.0
|
||||||
|
* Introduce Y067: Don't use Incomplete | None = None.
|
||||||
|
* Introduce Y091: Protocol method parameters should not be
|
||||||
|
positional-or-keyword.
|
||||||
|
* Y011/Y015 will now allow all defaults that include an attribute
|
||||||
|
access, for example math.inf or enum members.
|
||||||
|
* Development-only dependencies are now declared using dependency
|
||||||
|
groups rather than optional dependencies.
|
||||||
|
* The plugin now exists as a flake8_pyi package rather than a
|
||||||
|
single pyi.py file.
|
||||||
|
* Declare support for Python 3.14
|
||||||
|
- Add fix-tests.patch cleaning up the code for old detritus,
|
||||||
|
which broke tests.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Oct 29 21:15:28 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
- update to 24.9.0:
|
||||||
|
* Don't emit Y053 for long strings inside `Literal` slices or
|
||||||
|
* metadata strings inside `Annotated` slices.
|
||||||
|
* `flake8-pyi` no longer supports being run using Python 3.8.
|
||||||
|
As a result, it not longer depends on the third-party
|
||||||
|
`ast_decompiler` package.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sat Jun 15 15:36:11 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
Sat Jun 15 15:36:11 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-flake8-pyi
|
# spec file for package python-flake8-pyi
|
||||||
#
|
#
|
||||||
# Copyright (c) 2024 SUSE LLC
|
# Copyright (c) 2025 SUSE LLC and contributors
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
%{?sle15_python_module_pythons}
|
%{?sle15_python_module_pythons}
|
||||||
Name: python-flake8-pyi
|
Name: python-flake8-pyi
|
||||||
Version: 24.6.0
|
Version: 25.5.0
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: A plugin for flake8 to enable linting .pyi files
|
Summary: A plugin for flake8 to enable linting .pyi files
|
||||||
License: MIT
|
License: MIT
|
||||||
@@ -28,7 +28,8 @@ Source: https://files.pythonhosted.org/packages/source/f/flake8-pyi/flak
|
|||||||
# PATCH-FIX-OPENSUSE set-tests-python-path.patch, patch to fix
|
# PATCH-FIX-OPENSUSE set-tests-python-path.patch, patch to fix
|
||||||
# PYTHONPATH resolution for tests running inside osc
|
# PYTHONPATH resolution for tests running inside osc
|
||||||
Patch0: set-tests-python-path.patch
|
Patch0: set-tests-python-path.patch
|
||||||
BuildRequires: %{python_module ast-decompiler}
|
# PATCH-FIX-UPSTREAM https://github.com/PyCQA/flake8-pyi/pull/526 Fix tests to reflect the current state
|
||||||
|
Patch1: fix-tests.patch
|
||||||
BuildRequires: %{python_module base >= 3.8.0}
|
BuildRequires: %{python_module base >= 3.8.0}
|
||||||
BuildRequires: %{python_module hatch_vcs}
|
BuildRequires: %{python_module hatch_vcs}
|
||||||
BuildRequires: %{python_module hatchling}
|
BuildRequires: %{python_module hatchling}
|
||||||
@@ -36,7 +37,6 @@ BuildRequires: %{python_module pip}
|
|||||||
BuildRequires: %{python_module wheel}
|
BuildRequires: %{python_module wheel}
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
# SECTION test requirements
|
# SECTION test requirements
|
||||||
BuildRequires: %{python_module attrs}
|
|
||||||
BuildRequires: %{python_module flake8 >= 6.0.0}
|
BuildRequires: %{python_module flake8 >= 6.0.0}
|
||||||
BuildRequires: %{python_module pyflakes >= 2.1.1}
|
BuildRequires: %{python_module pyflakes >= 2.1.1}
|
||||||
# Use pytest directly to bypass setup.py test dependencies
|
# Use pytest directly to bypass setup.py test dependencies
|
||||||
@@ -44,14 +44,11 @@ BuildRequires: %{python_module pytest}
|
|||||||
BuildRequires: %{python_module black}
|
BuildRequires: %{python_module black}
|
||||||
BuildRequires: %{python_module flake8-bugbear}
|
BuildRequires: %{python_module flake8-bugbear}
|
||||||
BuildRequires: %{python_module pytest-xdist}
|
BuildRequires: %{python_module pytest-xdist}
|
||||||
BuildRequires: %{python_module typing}
|
|
||||||
# /SECTION
|
# /SECTION
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
Requires: python-attrs
|
|
||||||
Requires: python-base >= 3.8.0
|
Requires: python-base >= 3.8.0
|
||||||
Requires: python-flake8 >= 6.0.0
|
Requires: python-flake8 >= 6.0.0
|
||||||
Requires: python-pyflakes >= 2.1.1
|
Requires: python-pyflakes >= 2.1.1
|
||||||
Requires: python-typing
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%python_subpackages
|
%python_subpackages
|
||||||
@@ -62,7 +59,7 @@ files. Especially interesting for linting typeshed.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -p1 -n flake8_pyi-%{version}
|
%autosetup -p1 -n flake8_pyi-%{version}
|
||||||
sed -i '1{\,^#!%{_bindir}/env python,d}' pyi.py
|
sed -i '1{\,^#!%{_bindir}/env python,d}' flake8_pyi/visitor.py
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%pyproject_wheel
|
%pyproject_wheel
|
||||||
@@ -77,8 +74,7 @@ sed -i '1{\,^#!%{_bindir}/env python,d}' pyi.py
|
|||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc README.md
|
%doc README.md
|
||||||
%{python_sitelib}/pyi.py*
|
%{python_sitelib}/flake8_pyi
|
||||||
%{pycache_only %{python_sitelib}/__pycache__/pyi.*.py*}
|
|
||||||
%{python_sitelib}/flake8_pyi-%{version}*-info
|
%{python_sitelib}/flake8_pyi-%{version}*-info
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
Index: flake8_pyi-23.11.0/tests/test_pyi_files.py
|
Index: flake8_pyi-25.5.0/tests/test_pyi_files.py
|
||||||
===================================================================
|
===================================================================
|
||||||
--- flake8_pyi-23.11.0.orig/tests/test_pyi_files.py
|
--- flake8_pyi-25.5.0.orig/tests/test_pyi_files.py
|
||||||
+++ flake8_pyi-23.11.0/tests/test_pyi_files.py
|
+++ flake8_pyi-25.5.0/tests/test_pyi_files.py
|
||||||
@@ -43,6 +43,9 @@ def test_pyi_file(path: str) -> None:
|
@@ -43,6 +43,9 @@ def test_pyi_file(path: str) -> None:
|
||||||
option = flag.split("=")[0]
|
option = flag.split("=")[0]
|
||||||
assert option not in {"--ignore", "--select"}, bad_flag_msg(option[2:])
|
assert option not in {"--ignore", "--select"}, bad_flag_msg(option[2:])
|
||||||
@@ -14,10 +14,10 @@ Index: flake8_pyi-23.11.0/tests/test_pyi_files.py
|
|||||||
# For DeprecationWarnings coming from flake8-pyi itself,
|
# For DeprecationWarnings coming from flake8-pyi itself,
|
||||||
@@ -51,6 +54,8 @@ def test_pyi_file(path: str) -> None:
|
@@ -51,6 +54,8 @@ def test_pyi_file(path: str) -> None:
|
||||||
# but the test failure report that pytest gives is much easier to read
|
# but the test failure report that pytest gives is much easier to read
|
||||||
# if we use `-Wdefault:::pyi`
|
# if we use `-Wdefault:::flake8_pyi`
|
||||||
flake8_invocation = [
|
flake8_invocation = [
|
||||||
+ "env",
|
+ "env",
|
||||||
+ pythonpath,
|
+ pythonpath,
|
||||||
sys.executable,
|
sys.executable,
|
||||||
"-Wignore",
|
"-Wignore",
|
||||||
"-Wdefault:::pyi",
|
"-Wdefault:::flake8_pyi",
|
||||||
|
|||||||
Reference in New Issue
Block a user