Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 21, 2023
1 parent 1aece4a commit 7b78578
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions src/poetry/core/packages/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@
import posixpath
import re
import sys

from contextlib import suppress
from pathlib import Path
from typing import TYPE_CHECKING, Dict, List, Tuple
from urllib.parse import unquote, urlsplit
from typing import TYPE_CHECKING
from typing import Dict
from typing import List
from typing import Tuple
from urllib.parse import unquote
from urllib.parse import urlsplit
from urllib.request import url2pathname

from poetry.core.constraints.version import (
Version,
VersionRange,
parse_marker_version_constraint,
)
from poetry.core.version.markers import SingleMarkerLike, dnf
from poetry.core.constraints.version import Version
from poetry.core.constraints.version import VersionRange
from poetry.core.constraints.version import parse_marker_version_constraint
from poetry.core.version.markers import SingleMarkerLike
from poetry.core.version.markers import dnf


if TYPE_CHECKING:
from poetry.core.constraints.generic import BaseConstraint
Expand Down Expand Up @@ -150,7 +155,9 @@ def splitext(path: str) -> tuple[str, str]:


def convert_markers(marker: BaseMarker) -> ConvertedMarkers:
from poetry.core.version.markers import MarkerUnion, MultiMarker, SingleMarker
from poetry.core.version.markers import MarkerUnion
from poetry.core.version.markers import MultiMarker
from poetry.core.version.markers import SingleMarker

requirements: ConvertedMarkers = {}
marker = dnf(marker)
Expand Down Expand Up @@ -203,11 +210,9 @@ def create_nested_marker(
name: str,
constraint: BaseConstraint | VersionConstraint,
) -> str:
from poetry.core.constraints.generic import (
Constraint,
MultiConstraint,
UnionConstraint,
)
from poetry.core.constraints.generic import Constraint
from poetry.core.constraints.generic import MultiConstraint
from poetry.core.constraints.generic import UnionConstraint
from poetry.core.constraints.version import VersionUnion

if constraint.is_any():
Expand Down Expand Up @@ -299,7 +304,8 @@ def create_nested_marker(
def get_python_constraint_from_marker(
marker: BaseMarker,
) -> VersionConstraint:
from poetry.core.constraints.version import EmptyConstraint, VersionRange
from poetry.core.constraints.version import EmptyConstraint
from poetry.core.constraints.version import VersionRange

python_marker = marker.only("python_version", "python_full_version")
if python_marker.is_any():
Expand Down

0 comments on commit 7b78578

Please sign in to comment.