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

Fixed pdm list output containing full license text in some cases #2539

Merged
merged 6 commits into from
Jan 8, 2024

Conversation

JohnHardy
Copy link
Contributor

@JohnHardy JohnHardy commented Jan 5, 2024

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.

The full license string can sometimes be contained inside the package metadata license field, for example:

license = { file="LICENSE" } in pyproject.toml

This has been fixed by checking for the presence of newlines in the license variable, or if it is larger than 50 chars (slightly more than the longest OSI license field).

The tests have been updated.

Note that when exporting the markdown file that contains all the licenses (and full text) the full text license is still not exported. This is because it will always look inside: locations = ("**/LICENSE*", "**/LICENCE*", "**/COPYING*", "**/NOTICE*")

Closes #2538

Before

╭────────────────────────────┬────────────────────────────────┬───────────────────────────────────────────────────────────────────────────────╮
│ name                       │ version                        │ licenses                                                                      │
├────────────────────────────┼────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────┤
│ Arpeggio                   │ 2.0.0                          │ MIT                                                                           │
│ arrow                      │ 1.2.3                          │ Apache 2.0                                                                    │
│ attrs                      │ 23.1.0                         │ MIT License                                                                   │
│ binaryornot                │ 0.4.4                          │ BSD                                                                           │
...
│ platformdirs               │ 3.10.0                         │ MIT License                                                                   │
│ pluggy                     │ 1.2.0                          │ MIT                                                                           │
│ plumbum                    │ 1.8.2                          │ Copyright (c) 2013 Tomer Filiba ([email protected])                       │
│                            │                                │                                                                               │
│                            │                                │ Permission is hereby granted, free of charge, to any person obtaining a copy  │
│                            │                                │ of this software and associated documentation files (the "Software"), to deal │
│                            │                                │ in the Software without restriction, including without limitation the rights  │
│                            │                                │ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell     │

After

╭────────────────────────────┬────────────────────────────────┬─────────────────────────────────────────────────╮
│ name                       │ version                        │ licenses                                        │
├────────────────────────────┼────────────────────────────────┼─────────────────────────────────────────────────┤
│ Arpeggio                   │ 2.0.0                          │ MIT                                             │
│ arrow                      │ 1.2.3                          │ Apache 2.0                                      │
│ attrs                      │ 23.1.0                         │ MIT License                                     │
│ binaryornot                │ 0.4.4                          │ BSD                                             │
...
│ platformdirs               │ 3.10.0                         │ MIT License                                     │
│ pluggy                     │ 1.2.0                          │ MIT                                             │
│ plumbum                    │ 1.8.2                          │ MIT License                                     │
│ prompt-toolkit             │ 3.0.38                         │ BSD License                                     │
│ pycomplete                 │ 0.4.0                          │ BSD-3-Clause                                    │

Copy link

codecov bot commented Jan 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ca74c76) 84.63% compared to head (c8714b6) 84.63%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2539   +/-   ##
=======================================
  Coverage   84.63%   84.63%           
=======================================
  Files         104      104           
  Lines       10343    10344    +1     
  Branches     2261     2261           
=======================================
+ Hits         8754     8755    +1     
  Misses       1116     1116           
  Partials      473      473           
Flag Coverage Δ
unittests 84.42% <100.00%> (+<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.

@frostming frostming merged commit 2160ec1 into pdm-project:main Jan 8, 2024
21 checks passed
@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
Development

Successfully merging this pull request may close these issues.

pdm list contains full license text
2 participants