Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ repos:
- id: validate_manifest

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.4
rev: v0.7.3
hooks:
- id: ruff
- id: ruff-format
66 changes: 36 additions & 30 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ extend-exclude = [
# External to the project's coding standards
"tests/fixtures/git/*",
"tests/fixtures/project_with_setup*/*",
"tests/masonry/builders/fixtures/pep_561_stub_only*/*",
"tests/utils/fixtures/setups/*",
]
fix = true
line-length = 88
Expand Down
6 changes: 1 addition & 5 deletions src/poetry/console/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from cleo.events.event_dispatcher import EventDispatcher
from cleo.exceptions import CleoError
from cleo.formatters.style import Style
from cleo.io.null_io import NullIO

from poetry.__version__ import __version__
from poetry.console.command_loader import CommandLoader
Expand Down Expand Up @@ -322,13 +321,10 @@ def configure_installer_for_command(command: InstallerCommand, io: IO) -> None:
)
command.set_installer(installer)

def _load_plugins(self, io: IO | None = None) -> None:
def _load_plugins(self, io: IO) -> None:
if self._plugins_loaded:
return

if io is None:
io = NullIO()

self._disable_plugins = io.input.has_parameter_option("--no-plugins")

if not self._disable_plugins:
Expand Down
12 changes: 6 additions & 6 deletions src/poetry/inspection/lazy_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
from bisect import bisect_right
from contextlib import contextmanager
from tempfile import NamedTemporaryFile
from typing import IO
from typing import TYPE_CHECKING
from typing import Any
from typing import BinaryIO
from typing import ClassVar
from typing import cast
from urllib.parse import urlparse
from zipfile import BadZipFile
from zipfile import ZipFile
Expand Down Expand Up @@ -168,14 +167,14 @@ def minimal_intervals_covering(
yield from self._merge(start, end, left, right)


class ReadOnlyIOWrapper(BinaryIO):
"""Implement read-side ``BinaryIO`` methods wrapping an inner ``BinaryIO``.
class ReadOnlyIOWrapper(IO[bytes]):
"""Implement read-side ``IO[bytes]`` methods wrapping an inner ``IO[bytes]``.

This wrapper is useful because Python currently does not distinguish read-only
streams at the type level.
"""

def __init__(self, inner: BinaryIO) -> None:
def __init__(self, inner: IO[bytes]) -> None:
self._file = inner

def __enter__(self) -> Self:
Expand Down Expand Up @@ -296,7 +295,8 @@ def __init__(
session: Session | Authenticator,
delete_backing_file: bool = True,
) -> None:
super().__init__(cast(BinaryIO, NamedTemporaryFile(delete=delete_backing_file)))
inner = NamedTemporaryFile(delete=delete_backing_file) # noqa: SIM115
super().__init__(inner)

self._merge_intervals: MergeIntervals | None = None
self._length: int | None = None
Expand Down
2 changes: 1 addition & 1 deletion src/poetry/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def extractall(source: Path, dest: Path, zip: bool) -> None:
else:
# These versions of python shipped with a broken tarfile data_filter, per
# https://github.com/python/cpython/issues/107845.
broken_tarfile_filter = {(3, 8, 17), (3, 9, 17), (3, 10, 12), (3, 11, 4)}
broken_tarfile_filter = {(3, 9, 17), (3, 10, 12), (3, 11, 4)}
with tarfile.open(source) as archive:
if (
hasattr(tarfile, "data_filter")
Expand Down
2 changes: 1 addition & 1 deletion src/poetry/vcs/git/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def run(*args: Any, **kwargs: Any) -> None:
git_command = find_git_command()
env = os.environ.copy()
env["GIT_TERMINAL_PROMPT"] = "0"
subprocess.check_call( # type: ignore[call-arg]
subprocess.check_call(
git_command + list(args),
stderr=subprocess.DEVNULL,
stdout=subprocess.DEVNULL,
Expand Down
3 changes: 2 additions & 1 deletion tests/console/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ def poetry(
@pytest.fixture
def app(poetry: Poetry) -> PoetryTestApplication:
app_ = PoetryTestApplication(poetry)
app_._load_plugins()
io = NullIO()
app_._load_plugins(io)
return app_


Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_utils_vcs_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,11 @@ def test_system_git_fallback_on_http_401(

GIT_USERNAME = os.environ.get("POETRY_TEST_INTEGRATION_GIT_USERNAME")
GIT_PASSWORD = os.environ.get("POETRY_TEST_INTEGRATION_GIT_PASSWORD")
HTTP_AUTH_CREDENTIALS_AVAILABLE = not (GIT_USERNAME and GIT_PASSWORD)
HTTP_AUTH_CREDENTIALS_UNAVAILABLE = not (GIT_USERNAME and GIT_PASSWORD)


@pytest.mark.skipif(
HTTP_AUTH_CREDENTIALS_AVAILABLE,
HTTP_AUTH_CREDENTIALS_UNAVAILABLE,
reason="HTTP authentication credentials not available",
)
def test_configured_repository_http_auth(
Expand Down
Empty file.

This file was deleted.

14 changes: 0 additions & 14 deletions tests/masonry/builders/fixtures/pep_561_stub_only/pyproject.toml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions tests/utils/fixtures/setups/ansible/requirements.txt

This file was deleted.

Loading