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

Fix incompatibility with importlib-metadata 8 #2975

Merged
merged 4 commits into from
Jun 26, 2024

Conversation

JelleZijlstra
Copy link
Contributor

Fixes #2974

Pull Request Checklist

  • A news fragment is added in news/ describing what is new.
  • Test cases added for changed code.

Describe what you have changed in this PR.

Still running the test suite locally to verify whether existing tests catch this.

@sydney-runkle
Copy link

Thanks for this fix!

I think this might also be related: https://github.com/pydantic/pydantic/actions/runs/9670225358/job/26678546379 (an issue with Home-Page from dist.metadata). Thoughts?

@frostming
Copy link
Collaborator

Please fix other occurrences as well, search for (regex) metadata\["[A-Z] to find them.

You will also need a compatibility helper function for this to not repeat the try-catch everywhere.

@sydney-runkle
Copy link

Thanks @JelleZijlstra, quite speedy 😎!

@JelleZijlstra
Copy link
Contributor Author

Thanks, do you know if it is safe to assume that the "Name" key is always present? That's the one PDM looks at most frequently.

Copy link

codecov bot commented Jun 26, 2024

Codecov Report

Attention: Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 85.18%. Comparing base (7664d7b) to head (639e00a).
Report is 105 commits behind head on main.

Files with missing lines Patch % Lines
src/pdm/utils.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2975      +/-   ##
==========================================
- Coverage   85.18%   85.18%   -0.01%     
==========================================
  Files         106      106              
  Lines       10735    10734       -1     
  Branches     2347     2347              
==========================================
- Hits         9145     9144       -1     
  Misses       1108     1108              
  Partials      482      482              
Flag Coverage Δ
unittests 84.96% <91.66%> (-0.01%) ⬇️

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.

@JelleZijlstra
Copy link
Contributor Author

Not sure what's causing the failure in 3.13 on Windows, but the same failure appeared on #2973, so it's probably not related to my changes.

@frostming frostming merged commit 18a75db into pdm-project:main Jun 26, 2024
23 of 24 checks passed
@frostming
Copy link
Collaborator

Thanks

@JelleZijlstra JelleZijlstra deleted the newimpmet branch June 26, 2024 03:02
@JelleZijlstra JelleZijlstra restored the newimpmet branch September 10, 2024 23:37
@JelleZijlstra JelleZijlstra deleted the newimpmet branch December 7, 2024 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2.16.0 regression - KeyError: 'Requires-Python' crash when running pdm add in github actions on python 3.8
3 participants