Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
sdispater committed Jul 10, 2023
1 parent dd00e6c commit 7f204da
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
37 changes: 22 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,24 @@
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 SingleMarker, 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 SingleMarker
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 @@ -149,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 @@ -202,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 @@ -298,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
5 changes: 3 additions & 2 deletions src/poetry/core/pyproject/formats/standard_content_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from packaging.utils import canonicalize_name

from poetry.core.json import validate_object
from poetry.core.packages.dependency_group import DependencyGroup
from poetry.core.packages.project_package import ProjectPackage
from poetry.core.pyproject.formats.content_format import ContentFormat
from poetry.core.pyproject.formats.validation_result import ValidationResult
Expand All @@ -15,7 +16,6 @@
from pathlib import Path
from typing import Any

from poetry.core.packages.dependency_group import DependencyGroup
from poetry.core.spdx.license import License


Expand Down Expand Up @@ -187,7 +187,8 @@ def hash_content(self) -> dict[str, Any]:
@property
def poetry_config(self) -> dict[str, Any]:
"""
The custom poetry configuration (i.e. the parts in [tool.poetry] that are not related to the package)
The custom poetry configuration
(i.e. the parts in [tool.poetry] that are not related to the package)
"""
relevant_keys: list[str] = ["packages", "include", "exclude", "source"]

Expand Down

0 comments on commit 7f204da

Please sign in to comment.