Skip to content

Commit b39240b

Browse files
authored
No longer emit a FutureWarning when run with flake8<5; add a CI job to run with flake8<5 (#293)
1 parent d8511bd commit b39240b

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

.github/workflows/check.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,21 @@ jobs:
5757
- run: pip install -e .
5858
- run: pip install -r requirements-dev.txt
5959
- run: python3 -m pytest -vv
60+
tests-flake8-v4:
61+
name: pytest suite with flake8 v4
62+
timeout-minutes: 10
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/checkout@v2
66+
- uses: actions/setup-python@v2
67+
with:
68+
# Run on Python 3.7, as the importlib_metadata compatibility problems with flake8 v5
69+
# are much less on Python 3.8+, where importlib.metadata is available in the stdlib
70+
python-version: 3.7
71+
- run: pip install "flake8<5"
72+
- run: pip install -e .
73+
- run: pip install -r requirements-dev.txt
74+
- run: python3 -m pytest -vv
6075
check-typeshed:
6176
name: typeshed_primer
6277
timeout-minutes: 5

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ Bugfixes:
1111
`__all__` definitions.
1212
* Expand Y015 so that errors are emitted for assignments to negative numbers.
1313

14+
Other changes:
15+
* Since v22.8.1, flake8-pyi has emitted a `FutureWarning` if run with flake8<5,
16+
warning that the plugin would soon become incompatible with flake8<5. Due to
17+
some issues that mean that some users are unable to upgrade to flake8>=5,
18+
however, flake8-pyi no longer intends to remove support for running the
19+
plugin with flake8<5 before Python 3.7 has reached end-of-life. As such, the
20+
`FutureWarning` is no longer emitted.
21+
1422
## 22.8.2
1523

1624
New error codes:

pyi.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,6 @@ def unparse(node: ast.AST) -> str:
4444
LOG = logging.getLogger("flake8.pyi")
4545
FLAKE8_MAJOR_VERSION = flake8.__version_info__[0]
4646

47-
if FLAKE8_MAJOR_VERSION < 5:
48-
import warnings
49-
50-
warnings.warn(
51-
(
52-
"flake8-pyi will drop support for running with flake8 < 5.0.0 "
53-
"in a future version. This will not happen until November 2022 "
54-
"at the earliest."
55-
),
56-
category=FutureWarning,
57-
)
58-
59-
6047
if sys.version_info >= (3, 9):
6148
_LiteralMember: TypeAlias = ast.expr
6249
else:

0 commit comments

Comments
 (0)