Skip to content

Commit b5c46f5

Browse files
authored
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
1 parent e0bc7f3 commit b5c46f5

File tree

6 files changed

+19
-15
lines changed

6 files changed

+19
-15
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ repos:
3333
additional_dependencies: &flake8_deps
3434
- flake8-annotations==2.9.0
3535
- flake8-broken-line==0.4.0
36-
- flake8-bugbear==22.4.25
36+
- flake8-bugbear==22.7.1
3737
- flake8-comprehensions==3.10.0
3838
- flake8-eradicate==1.2.1
3939
- flake8-quotes==3.3.1
40-
- flake8-simplify==0.19.2
40+
- flake8-simplify==0.19.3
4141
- flake8-tidy-imports==4.8.0
42-
- flake8-type-checking==1.5.0
42+
- flake8-type-checking==2.1.0
4343
- flake8-typing-imports==1.12.0
44-
- flake8-use-fstring==1.3
45-
- pep8-naming==0.12.1
44+
- flake8-use-fstring==1.4
45+
- pep8-naming==0.13.1
4646

4747
- repo: https://github.com/asottile/pyupgrade
4848
rev: v2.37.2

src/poetry/plugins/application_plugin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,6 @@ def commands(self) -> list[type[Command]]:
2424
def activate(self, application: Application) -> None:
2525
for command in self.commands:
2626
assert command.name is not None
27-
application.command_loader.register_factory(command.name, lambda: command())
27+
application.command_loader.register_factory(
28+
command.name, lambda: command() # noqa: B023
29+
)

src/poetry/puzzle/provider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,10 +670,10 @@ def complete_package(
670670
# - {<Package foo (1.2.3): {"bar": <Dependency bar (<2.0)>}
671671

672672
def fmt_warning(d: Dependency) -> str:
673-
marker = d.marker if not d.marker.is_any() else "*"
673+
dependency_marker = d.marker if not d.marker.is_any() else "*"
674674
return (
675675
f"<c1>{d.name}</c1> <fg=default>(<c2>{d.pretty_constraint}</c2>)</>"
676-
f" with markers <b>{marker}</b>"
676+
f" with markers <b>{dependency_marker}</b>"
677677
)
678678

679679
warnings = ", ".join(fmt_warning(d) for d in deps[:-1])

src/poetry/utils/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def _get_win_folder_with_ctypes(csidl_name: str) -> str:
220220
def get_win_folder(csidl_name: str) -> Path:
221221
if sys.platform == "win32":
222222
try:
223-
from ctypes import windll # noqa: F401
223+
from ctypes import windll # noqa: F401, TC003
224224

225225
_get_win_folder = _get_win_folder_with_ctypes
226226
except ImportError:

tests/compat.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
from __future__ import annotations
22

3+
import sys
34

4-
try:
5-
import zipp # nopycln: import
6-
except ImportError:
7-
import zipfile as zipp # noqa: F401, TC002
5+
6+
if sys.version_info < (3, 8):
7+
import zipp as zipfile # nopycln: import
8+
else:
9+
import zipfile # noqa: F401
810

911
try:
1012
from typing import Protocol # nopycln: import

tests/repositories/test_installed_repository.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from poetry.repositories.installed_repository import InstalledRepository
1010
from poetry.utils._compat import metadata
1111
from poetry.utils.env import MockEnv as BaseMockEnv
12-
from tests.compat import zipp
12+
from tests.compat import zipfile
1313

1414

1515
if TYPE_CHECKING:
@@ -27,7 +27,7 @@
2727
metadata.PathDistribution(SITE_PURELIB / "cleo-0.7.6.dist-info"),
2828
metadata.PathDistribution(SRC / "pendulum" / "pendulum.egg-info"),
2929
metadata.PathDistribution(
30-
zipp.Path(str(SITE_PURELIB / "foo-0.1.0-py3.8.egg"), "EGG-INFO")
30+
zipfile.Path(str(SITE_PURELIB / "foo-0.1.0-py3.8.egg"), "EGG-INFO")
3131
),
3232
metadata.PathDistribution(VENDOR_DIR / "attrs-19.3.0.dist-info"),
3333
metadata.PathDistribution(SITE_PURELIB / "standard-1.2.3.dist-info"),

0 commit comments

Comments
 (0)