Commit b5c46f57 by Mathieu Kniewallner Committed by GitHub

Update `flake8` additional dependencies (#6095)

* build(deps): update pre-commit additional dependencies

* chore: comply with `flake8-type-checking` following update

* chore: comply with `flake8-bugbear` following update

* refactor(tests): import `zipp` only on < 3.8
parent e0bc7f3f
...@@ -33,16 +33,16 @@ repos: ...@@ -33,16 +33,16 @@ repos:
additional_dependencies: &flake8_deps additional_dependencies: &flake8_deps
- flake8-annotations==2.9.0 - flake8-annotations==2.9.0
- flake8-broken-line==0.4.0 - flake8-broken-line==0.4.0
- flake8-bugbear==22.4.25 - flake8-bugbear==22.7.1
- flake8-comprehensions==3.10.0 - flake8-comprehensions==3.10.0
- flake8-eradicate==1.2.1 - flake8-eradicate==1.2.1
- flake8-quotes==3.3.1 - flake8-quotes==3.3.1
- flake8-simplify==0.19.2 - flake8-simplify==0.19.3
- flake8-tidy-imports==4.8.0 - flake8-tidy-imports==4.8.0
- flake8-type-checking==1.5.0 - flake8-type-checking==2.1.0
- flake8-typing-imports==1.12.0 - flake8-typing-imports==1.12.0
- flake8-use-fstring==1.3 - flake8-use-fstring==1.4
- pep8-naming==0.12.1 - pep8-naming==0.13.1
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
rev: v2.37.2 rev: v2.37.2
......
...@@ -24,4 +24,6 @@ class ApplicationPlugin(BasePlugin): ...@@ -24,4 +24,6 @@ class ApplicationPlugin(BasePlugin):
def activate(self, application: Application) -> None: def activate(self, application: Application) -> None:
for command in self.commands: for command in self.commands:
assert command.name is not None assert command.name is not None
application.command_loader.register_factory(command.name, lambda: command()) application.command_loader.register_factory(
command.name, lambda: command() # noqa: B023
)
...@@ -670,10 +670,10 @@ class Provider: ...@@ -670,10 +670,10 @@ class Provider:
# - {<Package foo (1.2.3): {"bar": <Dependency bar (<2.0)>} # - {<Package foo (1.2.3): {"bar": <Dependency bar (<2.0)>}
def fmt_warning(d: Dependency) -> str: def fmt_warning(d: Dependency) -> str:
marker = d.marker if not d.marker.is_any() else "*" dependency_marker = d.marker if not d.marker.is_any() else "*"
return ( return (
f"<c1>{d.name}</c1> <fg=default>(<c2>{d.pretty_constraint}</c2>)</>" f"<c1>{d.name}</c1> <fg=default>(<c2>{d.pretty_constraint}</c2>)</>"
f" with markers <b>{marker}</b>" f" with markers <b>{dependency_marker}</b>"
) )
warnings = ", ".join(fmt_warning(d) for d in deps[:-1]) warnings = ", ".join(fmt_warning(d) for d in deps[:-1])
......
...@@ -220,7 +220,7 @@ def _get_win_folder_with_ctypes(csidl_name: str) -> str: ...@@ -220,7 +220,7 @@ def _get_win_folder_with_ctypes(csidl_name: str) -> str:
def get_win_folder(csidl_name: str) -> Path: def get_win_folder(csidl_name: str) -> Path:
if sys.platform == "win32": if sys.platform == "win32":
try: try:
from ctypes import windll # noqa: F401 from ctypes import windll # noqa: F401, TC003
_get_win_folder = _get_win_folder_with_ctypes _get_win_folder = _get_win_folder_with_ctypes
except ImportError: except ImportError:
......
from __future__ import annotations from __future__ import annotations
import sys
try:
import zipp # nopycln: import if sys.version_info < (3, 8):
except ImportError: import zipp as zipfile # nopycln: import
import zipfile as zipp # noqa: F401, TC002 else:
import zipfile # noqa: F401
try: try:
from typing import Protocol # nopycln: import from typing import Protocol # nopycln: import
......
...@@ -9,7 +9,7 @@ import pytest ...@@ -9,7 +9,7 @@ import pytest
from poetry.repositories.installed_repository import InstalledRepository from poetry.repositories.installed_repository import InstalledRepository
from poetry.utils._compat import metadata from poetry.utils._compat import metadata
from poetry.utils.env import MockEnv as BaseMockEnv from poetry.utils.env import MockEnv as BaseMockEnv
from tests.compat import zipp from tests.compat import zipfile
if TYPE_CHECKING: if TYPE_CHECKING:
...@@ -27,7 +27,7 @@ INSTALLED_RESULTS = [ ...@@ -27,7 +27,7 @@ INSTALLED_RESULTS = [
metadata.PathDistribution(SITE_PURELIB / "cleo-0.7.6.dist-info"), metadata.PathDistribution(SITE_PURELIB / "cleo-0.7.6.dist-info"),
metadata.PathDistribution(SRC / "pendulum" / "pendulum.egg-info"), metadata.PathDistribution(SRC / "pendulum" / "pendulum.egg-info"),
metadata.PathDistribution( metadata.PathDistribution(
zipp.Path(str(SITE_PURELIB / "foo-0.1.0-py3.8.egg"), "EGG-INFO") zipfile.Path(str(SITE_PURELIB / "foo-0.1.0-py3.8.egg"), "EGG-INFO")
), ),
metadata.PathDistribution(VENDOR_DIR / "attrs-19.3.0.dist-info"), metadata.PathDistribution(VENDOR_DIR / "attrs-19.3.0.dist-info"),
metadata.PathDistribution(SITE_PURELIB / "standard-1.2.3.dist-info"), metadata.PathDistribution(SITE_PURELIB / "standard-1.2.3.dist-info"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment