Skip to content

Commit

Permalink
fix: fix support for packaging v20.4
Browse files Browse the repository at this point in the history
Poetry v1.2.2 does not work with packaging v20.4
(which is an allowed version of packaging in the pyproject.toml file).

This is because the `from packaging.utils import NormalizedName` line
before [packaging v20.5][1]
only works if `typing.TYPE_CHECKING` is True.

This is not an issue on the `master` branch, since there this
import is already hidden behind an `if TYPE_CHECKING:` guard.
However, the v1.2 branch never cherry-picked the appropriate
commit adding this change.

[1]: pypa/packaging@eca30e0

Fixes: 04c5cbf
  • Loading branch information
aloisklink committed Oct 15, 2022
1 parent 1aad242 commit beef142
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/poetry/installation/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from typing import TYPE_CHECKING

from cleo.io.null_io import NullIO
from packaging.utils import NormalizedName
from packaging.utils import canonicalize_name

from poetry.installation.executor import Executor
Expand All @@ -24,6 +23,7 @@
from collections.abc import Sequence

from cleo.io.io import IO
from packaging.utils import NormalizedName
from poetry.core.packages.project_package import ProjectPackage

from poetry.config.config import Config
Expand Down

0 comments on commit beef142

Please sign in to comment.