Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7f204da

Browse files
committedJul 10, 2023
Fix linting
1 parent dd00e6c commit 7f204da

File tree

2 files changed

+25
-17
lines changed

2 files changed

+25
-17
lines changed
 

‎src/poetry/core/packages/utils/utils.py

+22-15
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,24 @@
44
import posixpath
55
import re
66
import sys
7+
78
from contextlib import suppress
89
from pathlib import Path
9-
from typing import TYPE_CHECKING, Dict, List, Tuple
10-
from urllib.parse import unquote, urlsplit
10+
from typing import TYPE_CHECKING
11+
from typing import Dict
12+
from typing import List
13+
from typing import Tuple
14+
from urllib.parse import unquote
15+
from urllib.parse import urlsplit
1116
from urllib.request import url2pathname
1217

13-
from poetry.core.constraints.version import (
14-
Version,
15-
VersionRange,
16-
parse_marker_version_constraint,
17-
)
18-
from poetry.core.version.markers import SingleMarker, SingleMarkerLike, dnf
18+
from poetry.core.constraints.version import Version
19+
from poetry.core.constraints.version import VersionRange
20+
from poetry.core.constraints.version import parse_marker_version_constraint
21+
from poetry.core.version.markers import SingleMarker
22+
from poetry.core.version.markers import SingleMarkerLike
23+
from poetry.core.version.markers import dnf
24+
1925

2026
if TYPE_CHECKING:
2127
from poetry.core.constraints.generic import BaseConstraint
@@ -149,7 +155,9 @@ def splitext(path: str) -> tuple[str, str]:
149155

150156

151157
def convert_markers(marker: BaseMarker) -> ConvertedMarkers:
152-
from poetry.core.version.markers import MarkerUnion, MultiMarker, SingleMarker
158+
from poetry.core.version.markers import MarkerUnion
159+
from poetry.core.version.markers import MultiMarker
160+
from poetry.core.version.markers import SingleMarker
153161

154162
requirements: ConvertedMarkers = {}
155163
marker = dnf(marker)
@@ -202,11 +210,9 @@ def create_nested_marker(
202210
name: str,
203211
constraint: BaseConstraint | VersionConstraint,
204212
) -> str:
205-
from poetry.core.constraints.generic import (
206-
Constraint,
207-
MultiConstraint,
208-
UnionConstraint,
209-
)
213+
from poetry.core.constraints.generic import Constraint
214+
from poetry.core.constraints.generic import MultiConstraint
215+
from poetry.core.constraints.generic import UnionConstraint
210216
from poetry.core.constraints.version import VersionUnion
211217

212218
if constraint.is_any():
@@ -298,7 +304,8 @@ def create_nested_marker(
298304
def get_python_constraint_from_marker(
299305
marker: BaseMarker,
300306
) -> VersionConstraint:
301-
from poetry.core.constraints.version import EmptyConstraint, VersionRange
307+
from poetry.core.constraints.version import EmptyConstraint
308+
from poetry.core.constraints.version import VersionRange
302309

303310
python_marker = marker.only("python_version", "python_full_version")
304311
if python_marker.is_any():

‎src/poetry/core/pyproject/formats/standard_content_format.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from packaging.utils import canonicalize_name
66

77
from poetry.core.json import validate_object
8+
from poetry.core.packages.dependency_group import DependencyGroup
89
from poetry.core.packages.project_package import ProjectPackage
910
from poetry.core.pyproject.formats.content_format import ContentFormat
1011
from poetry.core.pyproject.formats.validation_result import ValidationResult
@@ -15,7 +16,6 @@
1516
from pathlib import Path
1617
from typing import Any
1718

18-
from poetry.core.packages.dependency_group import DependencyGroup
1919
from poetry.core.spdx.license import License
2020

2121

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

0 commit comments

Comments
 (0)
Please sign in to comment.