From fc265a397dabd10301c0d0d93768dc18ad2bf33d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 23:00:11 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.7.4 → v0.8.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.7.4...v0.8.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 877cd38c1..bb9e1370c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,7 +26,7 @@ repos: - id: check-docstring-first - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.4 + rev: v0.8.0 hooks: - id: ruff - id: ruff-format From d2b25f3e2d725575399bc96facbdc3f5bb0a5f29 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 23:00:19 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/poetry/core/constraints/generic/constraint.py | 6 ++++-- .../core/constraints/version/version_range_constraint.py | 7 ++----- src/poetry/core/packages/package.py | 2 +- src/poetry/core/version/pep440/__init__.py | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/poetry/core/constraints/generic/constraint.py b/src/poetry/core/constraints/generic/constraint.py index 0570e7ae5..3afa268cc 100644 --- a/src/poetry/core/constraints/generic/constraint.py +++ b/src/poetry/core/constraints/generic/constraint.py @@ -182,8 +182,10 @@ def union(self, other: BaseConstraint) -> BaseConstraint: if ( (ops in ({"!="}, {"not in"})) or ( - ops in ({"in", "!="}, {"in", "not in"}) - and (self.operator == "in" and self.value in other.value) + ( + ops in ({"in", "!="}, {"in", "not in"}) + and (self.operator == "in" and self.value in other.value) + ) or (other.operator == "in" and other.value in self.value) ) or self.invert() == other diff --git a/src/poetry/core/constraints/version/version_range_constraint.py b/src/poetry/core/constraints/version/version_range_constraint.py index 41105790b..df76423b9 100644 --- a/src/poetry/core/constraints/version/version_range_constraint.py +++ b/src/poetry/core/constraints/version/version_range_constraint.py @@ -117,9 +117,6 @@ def is_adjacent_to(self, other: VersionRangeConstraint) -> bool: if self.max != other.min: return False - return ( - self.include_max - and not other.include_min - or not self.include_max - and other.include_min + return (self.include_max and not other.include_min) or ( + not self.include_max and other.include_min ) diff --git a/src/poetry/core/packages/package.py b/src/poetry/core/packages/package.py index 45b9a34b8..1ec93f24c 100644 --- a/src/poetry/core/packages/package.py +++ b/src/poetry/core/packages/package.py @@ -461,7 +461,7 @@ def with_dependency_groups( updated_groups = { group_name: group for group_name, group in self._dependency_groups.items() - if group_name in groups or not only and not group.is_optional() + if group_name in groups or (not only and not group.is_optional()) } package = self.clone() package._dependency_groups = updated_groups diff --git a/src/poetry/core/version/pep440/__init__.py b/src/poetry/core/version/pep440/__init__.py index 013b7f912..5845305ca 100644 --- a/src/poetry/core/version/pep440/__init__.py +++ b/src/poetry/core/version/pep440/__init__.py @@ -6,4 +6,4 @@ from poetry.core.version.pep440.version import PEP440Version -__all__ = ("LocalSegmentType", "Release", "ReleaseTag", "PEP440Version") +__all__ = ("LocalSegmentType", "PEP440Version", "Release", "ReleaseTag")