Skip to content

Commit a52c847

Browse files
radoeringneersighted
authored andcommitted
chore: avoid deprecation warning when used with poetry-core >= 1.3
1 parent dd3b674 commit a52c847

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/poetry_plugin_export/walker.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,20 @@
33
from typing import TYPE_CHECKING
44

55
from packaging.utils import canonicalize_name
6-
from poetry.core.semver.util import constraint_regions
6+
7+
8+
try:
9+
# turn isort off because it moves the "type: ignore" to the next line
10+
# isort: off
11+
from poetry.core.constraints.version.util import ( # type: ignore[import]
12+
constraint_regions,
13+
)
14+
15+
# isort: on
16+
except ImportError:
17+
# poetry-core < 1.3
18+
from poetry.core.semver.util import constraint_regions
19+
720
from poetry.core.version.markers import AnyMarker
821
from poetry.core.version.markers import SingleMarker
922
from poetry.packages import DependencyPackage

0 commit comments

Comments
 (0)