|
4 | 4 | import posixpath
|
5 | 5 | import re
|
6 | 6 | import sys
|
| 7 | + |
7 | 8 | from contextlib import suppress
|
8 | 9 | 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 |
11 | 16 | from urllib.request import url2pathname
|
12 | 17 |
|
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 | + |
19 | 25 |
|
20 | 26 | if TYPE_CHECKING:
|
21 | 27 | from poetry.core.constraints.generic import BaseConstraint
|
@@ -149,7 +155,9 @@ def splitext(path: str) -> tuple[str, str]:
|
149 | 155 |
|
150 | 156 |
|
151 | 157 | 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 |
153 | 161 |
|
154 | 162 | requirements: ConvertedMarkers = {}
|
155 | 163 | marker = dnf(marker)
|
@@ -202,11 +210,9 @@ def create_nested_marker(
|
202 | 210 | name: str,
|
203 | 211 | constraint: BaseConstraint | VersionConstraint,
|
204 | 212 | ) -> 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 |
210 | 216 | from poetry.core.constraints.version import VersionUnion
|
211 | 217 |
|
212 | 218 | if constraint.is_any():
|
@@ -298,7 +304,8 @@ def create_nested_marker(
|
298 | 304 | def get_python_constraint_from_marker(
|
299 | 305 | marker: BaseMarker,
|
300 | 306 | ) -> 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 |
302 | 309 |
|
303 | 310 | python_marker = marker.only("python_version", "python_full_version")
|
304 | 311 | if python_marker.is_any():
|
|
0 commit comments