Skip to content

Commit

Permalink
chore(lib): enhance warning message (#2523)
Browse files Browse the repository at this point in the history
* chore(lib): enhance warning message

Closes #2522.

* chore(lib): fix message to be more correct
  • Loading branch information
jeertmans authored Jan 2, 2024
1 parent ebc3eb6 commit 8dfcd62
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pdm/models/repositories.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@ def python_specifier(spec: str | PySpecSet) -> str:
warnings.warn(
f"Skipping {candidate.name}@{candidate.version} because it requires "
f"{python_specifier(candidate.requires_python)} but the project claims to work with "
f"{python_specifier(project_requires_python)}.\nNarrow down the `requires-python` range to "
f"{python_specifier(project_requires_python)}. Instead, another version of "
f"{candidate.name} that supports {python_specifier(project_requires_python)} will "
f"be used.\nIf you want to install {candidate.name}@{candidate.version}, "
"narrow down the `requires-python` range to "
f'include this version. For example, "{working_requires_python}" should work.',
PackageWarning,
stacklevel=4,
Expand Down

0 comments on commit 8dfcd62

Please sign in to comment.