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/poetry-import #1133

Merged
merged 4 commits into from
Jun 13, 2022
Merged

Fix/poetry-import #1133

merged 4 commits into from
Jun 13, 2022

Conversation

frostming
Copy link
Collaborator

Pull Request Check List

  • 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.

Close #1131

@adam-grant-hendry
Copy link

@frostming Be careful with your changes. license can also accept a file argument, not just a text argument. You're going to have to support both to be PEP 621 compliant:

The table may have one of two keys. The file key has a string value that is a relative file path to the file which contains the license for the project. Tools MUST assume the file’s encoding is UTF-8. The text key has a string value which is the license of the project whose meaning is that of the License field from the core metadata. These keys are mutually exclusive, so a tool MUST raise an error if the metadata specifies both keys.

A practical string value for the license key has been purposefully left out to allow for a future PEP to specify support for SPDX expressions (the same logic applies to any sort of “type” field specifying what license the file or text represents)

@frostming
Copy link
Collaborator Author

@adam-grant-hendry

Thank you, I am only changing the format converter, per poetry and flit's old metadata format, the license field of both accepts a string representing the license name, which goes to text sub field.

@codecov-commenter
Copy link

codecov-commenter commented Jun 13, 2022

Codecov Report

Merging #1133 (0661370) into main (af71fc8) will decrease coverage by 0.03%.
The diff coverage is 58.33%.

@@            Coverage Diff             @@
##             main    #1133      +/-   ##
==========================================
- Coverage   84.37%   84.33%   -0.04%     
==========================================
  Files          74       74              
  Lines        6579     6582       +3     
  Branches     1544     1546       +2     
==========================================
  Hits         5551     5551              
- Misses        698      701       +3     
  Partials      330      330              
Flag Coverage Δ
unittests 84.09% <58.33%> (-0.04%) ⬇️

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

Impacted Files Coverage Δ
pdm/formats/flit.py 75.55% <0.00%> (ø)
pdm/formats/poetry.py 89.85% <50.00%> (-2.00%) ⬇️
pdm/formats/legacy.py 76.92% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update af71fc8...0661370. Read the comment docs.

@frostming frostming merged commit c60c2ba into main Jun 13, 2022
@frostming frostming deleted the fix/poetry-import branch June 13, 2022 04:22
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.

PDM Fails to Parse license-expression
3 participants