mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-29 10:36:53 +00:00
require python 3.8.1+
This commit is contained in:
parent
16c371d41c
commit
aa002ee4ed
12 changed files with 70 additions and 94 deletions
18
.github/workflows/main.yml
vendored
18
.github/workflows/main.yml
vendored
|
|
@ -13,10 +13,7 @@ jobs:
|
|||
include:
|
||||
# linux
|
||||
- os: ubuntu-latest
|
||||
python: pypy-3.7
|
||||
toxenv: py
|
||||
- os: ubuntu-latest
|
||||
python: 3.7
|
||||
python: pypy-3.8
|
||||
toxenv: py
|
||||
- os: ubuntu-latest
|
||||
python: 3.8
|
||||
|
|
@ -25,21 +22,24 @@ jobs:
|
|||
python: 3.9
|
||||
toxenv: py
|
||||
- os: ubuntu-latest
|
||||
python: '3.10.0-alpha - 3.10.999'
|
||||
python: '3.10'
|
||||
toxenv: py
|
||||
- os: ubuntu-latest
|
||||
python: '3.11'
|
||||
toxenv: py
|
||||
# windows
|
||||
- os: windows-latest
|
||||
python: 3.7
|
||||
python: 3.8
|
||||
toxenv: py
|
||||
# misc
|
||||
- os: ubuntu-latest
|
||||
python: 3.9
|
||||
python: '3.10'
|
||||
toxenv: docs
|
||||
- os: ubuntu-latest
|
||||
python: 3.9
|
||||
python: '3.10'
|
||||
toxenv: linters
|
||||
- os: ubuntu-latest
|
||||
python: 3.9
|
||||
python: '3.10'
|
||||
toxenv: dogfood
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
|
|
|
|||
|
|
@ -13,14 +13,14 @@ repos:
|
|||
- id: reorder-python-imports
|
||||
args: [
|
||||
--application-directories, '.:src',
|
||||
--py37-plus,
|
||||
--py38-plus,
|
||||
--add-import, 'from __future__ import annotations',
|
||||
]
|
||||
- repo: https://github.com/asottile/pyupgrade
|
||||
rev: v3.2.2
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
args: [--py37-plus]
|
||||
args: [--py38-plus]
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 22.10.0
|
||||
hooks:
|
||||
|
|
|
|||
|
|
@ -20,10 +20,6 @@ classifiers =
|
|||
Programming Language :: Python
|
||||
Programming Language :: Python :: 3
|
||||
Programming Language :: Python :: 3 :: Only
|
||||
Programming Language :: Python :: 3.7
|
||||
Programming Language :: Python :: 3.8
|
||||
Programming Language :: Python :: 3.9
|
||||
Programming Language :: Python :: 3.10
|
||||
Programming Language :: Python :: Implementation :: CPython
|
||||
Programming Language :: Python :: Implementation :: PyPy
|
||||
Topic :: Software Development :: Libraries :: Python Modules
|
||||
|
|
@ -41,8 +37,8 @@ install_requires =
|
|||
mccabe>=0.7.0,<0.8.0
|
||||
pycodestyle>=2.9.0,<2.10.0
|
||||
pyflakes>=2.5.0,<2.6.0
|
||||
importlib-metadata>=1.1.0,<4.3;python_version<"3.8"
|
||||
python_requires = >=3.7
|
||||
# 3.8.0's importlib.metadata is broken
|
||||
python_requires = >=3.8.1
|
||||
|
||||
[options.packages.find]
|
||||
where = src
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
"""Expose backports in a single place."""
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
|
||||
if sys.version_info >= (3, 8): # pragma: no cover (PY38+)
|
||||
import importlib.metadata as importlib_metadata
|
||||
else: # pragma: no cover (<PY38)
|
||||
import importlib_metadata
|
||||
|
||||
if sys.version_info[:3] == (3, 8, 0):
|
||||
# backported from importlib.metadata in 3.8.1
|
||||
importlib_metadata.EntryPoint.__reduce__ = lambda self: ( # type: ignore
|
||||
type(self),
|
||||
(self.name, self.value, self.group), # type: ignore
|
||||
)
|
||||
|
||||
__all__ = ("importlib_metadata",)
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import configparser
|
||||
import importlib.metadata
|
||||
import inspect
|
||||
import itertools
|
||||
import logging
|
||||
|
|
@ -12,7 +13,6 @@ from typing import Iterable
|
|||
from typing import NamedTuple
|
||||
|
||||
from flake8 import utils
|
||||
from flake8._compat import importlib_metadata
|
||||
from flake8.defaults import VALID_CODE_PREFIX
|
||||
from flake8.exceptions import ExecutionError
|
||||
from flake8.exceptions import FailedToLoadPlugin
|
||||
|
|
@ -32,7 +32,7 @@ class Plugin(NamedTuple):
|
|||
|
||||
package: str
|
||||
version: str
|
||||
entry_point: importlib_metadata.EntryPoint
|
||||
entry_point: importlib.metadata.EntryPoint
|
||||
|
||||
|
||||
class LoadedPlugin(NamedTuple):
|
||||
|
|
@ -148,12 +148,12 @@ def parse_plugin_options(
|
|||
|
||||
|
||||
def _flake8_plugins(
|
||||
eps: Iterable[importlib_metadata.EntryPoint],
|
||||
eps: Iterable[importlib.metadata.EntryPoint],
|
||||
name: str,
|
||||
version: str,
|
||||
) -> Generator[Plugin, None, None]:
|
||||
pyflakes_meta = importlib_metadata.distribution("pyflakes").metadata
|
||||
pycodestyle_meta = importlib_metadata.distribution("pycodestyle").metadata
|
||||
pyflakes_meta = importlib.metadata.distribution("pyflakes").metadata
|
||||
pycodestyle_meta = importlib.metadata.distribution("pycodestyle").metadata
|
||||
|
||||
for ep in eps:
|
||||
if ep.group not in FLAKE8_GROUPS:
|
||||
|
|
@ -176,7 +176,7 @@ def _flake8_plugins(
|
|||
def _find_importlib_plugins() -> Generator[Plugin, None, None]:
|
||||
# some misconfigured pythons (RHEL) have things on `sys.path` twice
|
||||
seen = set()
|
||||
for dist in importlib_metadata.distributions():
|
||||
for dist in importlib.metadata.distributions():
|
||||
# assigned to prevent continual reparsing
|
||||
eps = dist.entry_points
|
||||
|
||||
|
|
@ -221,7 +221,7 @@ def _find_local_plugins(
|
|||
):
|
||||
name, _, entry_str = plugin_s.partition("=")
|
||||
name, entry_str = name.strip(), entry_str.strip()
|
||||
ep = importlib_metadata.EntryPoint(name, entry_str, group)
|
||||
ep = importlib.metadata.EntryPoint(name, entry_str, group)
|
||||
yield Plugin("local", "local", ep)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
"""Integration tests for the checker submodule."""
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib.metadata
|
||||
import sys
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
|
||||
from flake8 import checker
|
||||
from flake8._compat import importlib_metadata
|
||||
from flake8.plugins import finder
|
||||
from flake8.processor import FileProcessor
|
||||
|
||||
|
|
@ -85,7 +85,7 @@ def mock_file_checker_with_plugin(plugin_target):
|
|||
finder.Plugin(
|
||||
"flake-package",
|
||||
"9001",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"Q",
|
||||
f"{plugin_target.__module__}:{plugin_target.__name__}",
|
||||
"flake8.extension",
|
||||
|
|
|
|||
|
|
@ -170,8 +170,6 @@ def test_tokenization_error_but_not_syntax_error(tmpdir, capsys):
|
|||
|
||||
if hasattr(sys, "pypy_version_info"): # pragma: no cover (pypy)
|
||||
expected = "t.py:2:1: E999 SyntaxError: end of file (EOF) in multi-line statement\n" # noqa: E501
|
||||
elif sys.version_info < (3, 8): # pragma: no cover (<cp38)
|
||||
expected = "t.py:2:1: E902 TokenError: EOF in multi-line statement\n"
|
||||
elif sys.version_info < (3, 10): # pragma: no cover (cp38+)
|
||||
expected = "t.py:1:8: E999 SyntaxError: unexpected EOF while parsing\n"
|
||||
else: # pragma: no cover (cp310+)
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import configparser
|
||||
import importlib.metadata
|
||||
import sys
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
|
||||
from flake8._compat import importlib_metadata
|
||||
from flake8.exceptions import ExecutionError
|
||||
from flake8.exceptions import FailedToLoadPlugin
|
||||
from flake8.plugins import finder
|
||||
|
|
@ -14,7 +14,7 @@ from flake8.plugins.pyflakes import FlakesChecker
|
|||
|
||||
|
||||
def _ep(name="X", value="dne:dne", group="flake8.extension"):
|
||||
return importlib_metadata.EntryPoint(name, value, group)
|
||||
return importlib.metadata.EntryPoint(name, value, group)
|
||||
|
||||
|
||||
def _plugin(package="local", version="local", ep=None):
|
||||
|
|
@ -91,7 +91,7 @@ Version: 9000.1.0
|
|||
d = tmp_path.joinpath("pyflakes.dist-info")
|
||||
d.mkdir()
|
||||
d.joinpath("METADATA").write_text(metadata)
|
||||
return importlib_metadata.PathDistribution(d)
|
||||
return importlib.metadata.PathDistribution(d)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
|
@ -104,7 +104,7 @@ Version: 9000.2.0
|
|||
d = tmp_path.joinpath("pycodestyle.dist-info")
|
||||
d.mkdir()
|
||||
d.joinpath("METADATA").write_text(metadata)
|
||||
return importlib_metadata.PathDistribution(d)
|
||||
return importlib.metadata.PathDistribution(d)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
|
@ -131,7 +131,7 @@ pylint = flake8.formatting.default:Pylint
|
|||
d.mkdir()
|
||||
d.joinpath("METADATA").write_text(metadata)
|
||||
d.joinpath("entry_points.txt").write_text(entry_points)
|
||||
return importlib_metadata.PathDistribution(d)
|
||||
return importlib.metadata.PathDistribution(d)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
|
@ -153,13 +153,13 @@ foo = flake8_foo:Formatter
|
|||
d.mkdir()
|
||||
d.joinpath("METADATA").write_text(metadata)
|
||||
d.joinpath("entry_points.txt").write_text(eps)
|
||||
return importlib_metadata.PathDistribution(d)
|
||||
return importlib.metadata.PathDistribution(d)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_distribution(pyflakes_dist, pycodestyle_dist):
|
||||
dists = {"pyflakes": pyflakes_dist, "pycodestyle": pycodestyle_dist}
|
||||
with mock.patch.object(importlib_metadata, "distribution", dists.get):
|
||||
with mock.patch.object(importlib.metadata, "distribution", dists.get):
|
||||
yield
|
||||
|
||||
|
||||
|
|
@ -172,7 +172,7 @@ def test_flake8_plugins(flake8_dist, mock_distribution):
|
|||
finder.Plugin(
|
||||
"pyflakes",
|
||||
"9000.1.0",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"F",
|
||||
"flake8.plugins.pyflakes:FlakesChecker",
|
||||
"flake8.extension",
|
||||
|
|
@ -181,7 +181,7 @@ def test_flake8_plugins(flake8_dist, mock_distribution):
|
|||
finder.Plugin(
|
||||
"pycodestyle",
|
||||
"9000.2.0",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"E",
|
||||
"flake8.plugins.pycodestyle:pycodestyle_logical",
|
||||
"flake8.extension",
|
||||
|
|
@ -190,7 +190,7 @@ def test_flake8_plugins(flake8_dist, mock_distribution):
|
|||
finder.Plugin(
|
||||
"pycodestyle",
|
||||
"9000.2.0",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"W",
|
||||
"flake8.plugins.pycodestyle:pycodestyle_physical",
|
||||
"flake8.extension",
|
||||
|
|
@ -199,14 +199,14 @@ def test_flake8_plugins(flake8_dist, mock_distribution):
|
|||
finder.Plugin(
|
||||
"flake8",
|
||||
"9001",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"default", "flake8.formatting.default:Default", "flake8.report"
|
||||
),
|
||||
),
|
||||
finder.Plugin(
|
||||
"flake8",
|
||||
"9001",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"pylint", "flake8.formatting.default:Pylint", "flake8.report"
|
||||
),
|
||||
),
|
||||
|
|
@ -220,7 +220,7 @@ def test_importlib_plugins(
|
|||
mock_distribution,
|
||||
caplog,
|
||||
):
|
||||
"""Ensure we can load plugins from importlib_metadata."""
|
||||
"""Ensure we can load plugins from importlib.metadata."""
|
||||
|
||||
# make sure flake8-colors is skipped
|
||||
flake8_colors_metadata = """\
|
||||
|
|
@ -236,7 +236,7 @@ flake8-colors = flake8_colors:ColorFormatter
|
|||
flake8_colors_d.mkdir()
|
||||
flake8_colors_d.joinpath("METADATA").write_text(flake8_colors_metadata)
|
||||
flake8_colors_d.joinpath("entry_points.txt").write_text(flake8_colors_eps)
|
||||
flake8_colors_dist = importlib_metadata.PathDistribution(flake8_colors_d)
|
||||
flake8_colors_dist = importlib.metadata.PathDistribution(flake8_colors_d)
|
||||
|
||||
unrelated_metadata = """\
|
||||
Metadata-Version: 2.1
|
||||
|
|
@ -251,10 +251,10 @@ unrelated = unrelated:main
|
|||
unrelated_d.mkdir()
|
||||
unrelated_d.joinpath("METADATA").write_text(unrelated_metadata)
|
||||
unrelated_d.joinpath("entry_points.txt").write_text(unrelated_eps)
|
||||
unrelated_dist = importlib_metadata.PathDistribution(unrelated_d)
|
||||
unrelated_dist = importlib.metadata.PathDistribution(unrelated_d)
|
||||
|
||||
with mock.patch.object(
|
||||
importlib_metadata,
|
||||
importlib.metadata,
|
||||
"distributions",
|
||||
return_value=[
|
||||
flake8_dist,
|
||||
|
|
@ -269,14 +269,14 @@ unrelated = unrelated:main
|
|||
finder.Plugin(
|
||||
"flake8-foo",
|
||||
"1.2.3",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"Q", "flake8_foo:Plugin", "flake8.extension"
|
||||
),
|
||||
),
|
||||
finder.Plugin(
|
||||
"pycodestyle",
|
||||
"9000.2.0",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"E",
|
||||
"flake8.plugins.pycodestyle:pycodestyle_logical",
|
||||
"flake8.extension",
|
||||
|
|
@ -285,7 +285,7 @@ unrelated = unrelated:main
|
|||
finder.Plugin(
|
||||
"pycodestyle",
|
||||
"9000.2.0",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"W",
|
||||
"flake8.plugins.pycodestyle:pycodestyle_physical",
|
||||
"flake8.extension",
|
||||
|
|
@ -294,7 +294,7 @@ unrelated = unrelated:main
|
|||
finder.Plugin(
|
||||
"pyflakes",
|
||||
"9000.1.0",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"F",
|
||||
"flake8.plugins.pyflakes:FlakesChecker",
|
||||
"flake8.extension",
|
||||
|
|
@ -303,21 +303,21 @@ unrelated = unrelated:main
|
|||
finder.Plugin(
|
||||
"flake8",
|
||||
"9001",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"default", "flake8.formatting.default:Default", "flake8.report"
|
||||
),
|
||||
),
|
||||
finder.Plugin(
|
||||
"flake8",
|
||||
"9001",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"pylint", "flake8.formatting.default:Pylint", "flake8.report"
|
||||
),
|
||||
),
|
||||
finder.Plugin(
|
||||
"flake8-foo",
|
||||
"1.2.3",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"foo", "flake8_foo:Formatter", "flake8.report"
|
||||
),
|
||||
),
|
||||
|
|
@ -336,7 +336,7 @@ def test_duplicate_dists(flake8_dist):
|
|||
# some poorly packaged pythons put lib and lib64 on sys.path resulting in
|
||||
# duplicates from `importlib.metadata.distributions`
|
||||
with mock.patch.object(
|
||||
importlib_metadata,
|
||||
importlib.metadata,
|
||||
"distributions",
|
||||
return_value=[
|
||||
flake8_dist,
|
||||
|
|
@ -369,7 +369,7 @@ def test_find_local_plugins(local_plugin_cfg):
|
|||
finder.Plugin(
|
||||
"local",
|
||||
"local",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"X",
|
||||
"mod:attr",
|
||||
"flake8.extension",
|
||||
|
|
@ -378,7 +378,7 @@ def test_find_local_plugins(local_plugin_cfg):
|
|||
finder.Plugin(
|
||||
"local",
|
||||
"local",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"Y",
|
||||
"mod2:attr",
|
||||
"flake8.extension",
|
||||
|
|
@ -387,7 +387,7 @@ def test_find_local_plugins(local_plugin_cfg):
|
|||
finder.Plugin(
|
||||
"local",
|
||||
"local",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"Z",
|
||||
"mod3:attr",
|
||||
"flake8.report",
|
||||
|
|
@ -474,7 +474,7 @@ def test_find_plugins(
|
|||
):
|
||||
opts = finder.PluginOptions.blank()
|
||||
with mock.patch.object(
|
||||
importlib_metadata,
|
||||
importlib.metadata,
|
||||
"distributions",
|
||||
return_value=[flake8_dist, flake8_foo_dist],
|
||||
):
|
||||
|
|
@ -484,52 +484,52 @@ def test_find_plugins(
|
|||
finder.Plugin(
|
||||
"flake8",
|
||||
"9001",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"default", "flake8.formatting.default:Default", "flake8.report"
|
||||
),
|
||||
),
|
||||
finder.Plugin(
|
||||
"flake8",
|
||||
"9001",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"pylint", "flake8.formatting.default:Pylint", "flake8.report"
|
||||
),
|
||||
),
|
||||
finder.Plugin(
|
||||
"flake8-foo",
|
||||
"1.2.3",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"Q", "flake8_foo:Plugin", "flake8.extension"
|
||||
),
|
||||
),
|
||||
finder.Plugin(
|
||||
"flake8-foo",
|
||||
"1.2.3",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"foo", "flake8_foo:Formatter", "flake8.report"
|
||||
),
|
||||
),
|
||||
finder.Plugin(
|
||||
"local",
|
||||
"local",
|
||||
importlib_metadata.EntryPoint("X", "mod:attr", "flake8.extension"),
|
||||
importlib.metadata.EntryPoint("X", "mod:attr", "flake8.extension"),
|
||||
),
|
||||
finder.Plugin(
|
||||
"local",
|
||||
"local",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"Y", "mod2:attr", "flake8.extension"
|
||||
),
|
||||
),
|
||||
finder.Plugin(
|
||||
"local",
|
||||
"local",
|
||||
importlib_metadata.EntryPoint("Z", "mod3:attr", "flake8.report"),
|
||||
importlib.metadata.EntryPoint("Z", "mod3:attr", "flake8.report"),
|
||||
),
|
||||
finder.Plugin(
|
||||
"pycodestyle",
|
||||
"9000.2.0",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"E",
|
||||
"flake8.plugins.pycodestyle:pycodestyle_logical",
|
||||
"flake8.extension",
|
||||
|
|
@ -538,7 +538,7 @@ def test_find_plugins(
|
|||
finder.Plugin(
|
||||
"pycodestyle",
|
||||
"9000.2.0",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"W",
|
||||
"flake8.plugins.pycodestyle:pycodestyle_physical",
|
||||
"flake8.extension",
|
||||
|
|
@ -547,7 +547,7 @@ def test_find_plugins(
|
|||
finder.Plugin(
|
||||
"pyflakes",
|
||||
"9000.1.0",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
"F",
|
||||
"flake8.plugins.pyflakes:FlakesChecker",
|
||||
"flake8.extension",
|
||||
|
|
@ -570,7 +570,7 @@ def test_find_plugins_plugin_is_present(flake8_foo_dist):
|
|||
)
|
||||
|
||||
with mock.patch.object(
|
||||
importlib_metadata,
|
||||
importlib.metadata,
|
||||
"distributions",
|
||||
return_value=[flake8_foo_dist],
|
||||
):
|
||||
|
|
@ -593,7 +593,7 @@ def test_find_plugins_plugin_is_missing(flake8_dist, flake8_foo_dist):
|
|||
)
|
||||
|
||||
with mock.patch.object(
|
||||
importlib_metadata,
|
||||
importlib.metadata,
|
||||
"distributions",
|
||||
return_value=[flake8_dist],
|
||||
):
|
||||
|
|
@ -623,7 +623,7 @@ def test_find_plugins_name_normalization(flake8_foo_dist):
|
|||
)
|
||||
|
||||
with mock.patch.object(
|
||||
importlib_metadata,
|
||||
importlib.metadata,
|
||||
"distributions",
|
||||
return_value=[flake8_foo_dist],
|
||||
):
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import importlib.metadata
|
||||
|
||||
import pytest
|
||||
|
||||
from flake8._compat import importlib_metadata
|
||||
from flake8.formatting import default
|
||||
from flake8.plugins import finder
|
||||
from flake8.plugins import reporter
|
||||
|
|
@ -24,7 +24,7 @@ def reporters():
|
|||
finder.Plugin(
|
||||
"flake8",
|
||||
"123",
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
name, f"{cls.__module__}:{cls.__name__}", "flake8.report"
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import importlib.metadata
|
||||
from unittest import mock
|
||||
|
||||
from flake8._compat import importlib_metadata
|
||||
from flake8.main import debug
|
||||
from flake8.plugins import finder
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ def test_debug_information():
|
|||
finder.Plugin(
|
||||
pkg,
|
||||
version,
|
||||
importlib_metadata.EntryPoint(
|
||||
importlib.metadata.EntryPoint(
|
||||
ep_name, "dne:dne", "flake8.extension"
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import importlib.metadata
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
|
||||
import flake8
|
||||
from flake8 import checker
|
||||
from flake8._compat import importlib_metadata
|
||||
from flake8.plugins import finder
|
||||
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ def test_raises_exception_on_failed_plugin(tmp_path, default_options):
|
|||
finder.Plugin(
|
||||
"plugin-name",
|
||||
"1.2.3",
|
||||
importlib_metadata.EntryPoint("X", "dne:dne", "flake8.extension"),
|
||||
importlib.metadata.EntryPoint("X", "dne:dne", "flake8.extension"),
|
||||
),
|
||||
mock.Mock(side_effect=ValueError),
|
||||
{},
|
||||
|
|
|
|||
2
tox.ini
2
tox.ini
|
|
@ -1,6 +1,6 @@
|
|||
[tox]
|
||||
minversion=2.3.1
|
||||
envlist = py37,py38,flake8,linters,docs
|
||||
envlist = py,flake8,linters,docs
|
||||
|
||||
[testenv]
|
||||
deps =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue