Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(lib): enhance warning message #2523

Merged
merged 2 commits into from
Jan 2, 2024
Merged

Conversation

jeertmans
Copy link
Contributor

@jeertmans jeertmans commented Dec 27, 2023

Closes #2522.

Pull Request Checklist

  • [ ] A news fragment is added in news/ describing what is new. N/A
  • [ ] Test cases added for changed code. N/A (?)

Describe what you have changed in this PR.

As discussed in #2522, the warning message is a bit misleading because the installation proceeds correctly, so this PR modifies the message to reflect that.

@jeertmans jeertmans marked this pull request as ready for review December 27, 2023 10:56
Copy link
Collaborator

@frostming frostming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that you may have made this information overly complicated in order to alleviate some possible panic. And that is not correct either.

We just iterate through each version of the package and see if the python range is compatible, but you call them all as "latest available version" , this is not the case, apparently.

@@ -196,9 +196,13 @@ def python_specifier(spec: str | PySpecSet) -> str:
if working_requires_python.is_impossible: # pragma: no cover
continue
warnings.warn(
f"Skipping {candidate.name}@{candidate.version} because it requires "
f"Could not install the latest available version for {candidate.name} "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it may not be the latest version, this is not accurate.

@jeertmans
Copy link
Contributor Author

I suspect that you may have made this information overly complicated in order to alleviate some possible panic. And that is not correct either.

We just iterate through each version of the package and see if the python range is compatible, but you call them all as "latest available version" , this is not the case, apparently.

This is what I was skeptical about, thanks for clarifying. I updated the message.

Copy link

codecov bot commented Jan 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e188ea2) 84.63% compared to head (af9abcf) 84.63%.
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2523   +/-   ##
=======================================
  Coverage   84.63%   84.63%           
=======================================
  Files         104      104           
  Lines       10345    10345           
  Branches     2262     2262           
=======================================
  Hits         8756     8756           
  Misses       1116     1116           
  Partials      473      473           
Flag Coverage Δ
unittests 84.42% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@frostming frostming merged commit 8dfcd62 into pdm-project:main Jan 2, 2024
21 checks passed
@jeertmans jeertmans deleted the patch-1 branch January 2, 2024 08:04
@j178 j178 mentioned this pull request Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants