-
Notifications
You must be signed in to change notification settings - Fork 49
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
feat: Use Project-URL
metadata as fallback if home-page
is None
#155
feat: Use Project-URL
metadata as fallback if home-page
is None
#155
Conversation
Codecov Report
@@ Coverage Diff @@
## release-4.2.0 #155 +/- ##
=================================================
- Coverage 99.51% 99.29% -0.22%
=================================================
Files 1 1
Lines 414 427 +13
=================================================
+ Hits 412 424 +12
- Misses 2 3 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Contributors other than myself introduced the type checking, for example, the following versioned code exists in if TYPE_CHECKING:
if sys.version_info >= (3, 10):
from importlib.metadata._meta import PackageMetadata
else:
from email.message import Message as PackageMetadata |
Thanks! I fixed the type and also improved the url extraction. |
Somehow, black doesn't work with the |
Okay the type annotations are still not correct. I'll fix this after the weekend. |
I am very sorry, I merged another PR and release-4.2.0 was rebased. Your working branch, fallback-for-url branch, also needs to be rebase to release-4.2.0. |
9839daf
to
7d6b668
Compare
No worries. I rebased the PR and fixed the type issues. |
7d6b668
to
3c73c46
Compare
3c73c46
to
8e04928
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, it's a great approach to be testable with just the function extract_homepage()
.
The commits also appear to have been combined into one, so we will merge them as they are.
@g3n35i5 I have created a release candidate version merging this PR. Could you please confirm that it is working as you intended? pip install "pip-licenses==4.2.0rc3" If there are no problems, I will proceed to a production release. |
Thanks! 4.2.0rc3 works as expected in my setup 👍 |
Hello again!
This PR basically cleans up my last fallback solution with a slightly more cleaner way to get the values from the metadata by using (type annotated) lambda functions and uses the first
Project-URL
value of the metadata.Current output:
New output: