Closed RhetTbull closed 2 years ago
Thanks for the detailed issue.
I believe I added some logic if there are multiple github repos for the other commands like description
. I forgot to do that in the information
command.
Yeah I should get it from pypi directly, I used to do that before I don't really remember why I removed that. I'll start working on it
Edit: I believe I did that because the project urls field of setuptools accepts a lot of items as keys, so the key of the dictionary could be named Source Code
or Github
or it may not even have a source code/github key and just have be named bug tracker with the github link for the issues page.
I'll just use the one from pypi if there are multiple links gotten from regex
Fixed. Update to 1.3.1
pip install --upgrade pypi-command-line
By the way, I just discovered oxsphotos a few days ago. It's great. Thanks for making that :)
First, just wanted to say thank for the very useful utility! It's especially impressive given your age. Well done!
Describe the bug The GitHub info pane produced by
pypi info
does not always show the correct info as the script is grabbing the wrong GitHub link from project README.To Reproduce Steps to reproduce the behavior:
pypi info osxphotos
Which is the GitHub info for pipx not osxphotos.
Also, try
pypi info osxmetadata
which shows this for the GitHub info:Expected behavior Expected to see the GitHub info for the project instead of a different project. This info is correctly shown by pypi.org.
Screenshots
pypi info osxphotos
Same info from pypi.org
pypi info osxmetadata
Same info from pypi.org
Desktop (please complete the following information):
Additional context I believe the problem occurs when the project README contains a link to a GitHub repo that is not the repo for the project. This is quite common. For example, in the examples above, the project README contains a badge for code style black:
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
And also instructions to use pipx for installation and these GitHub repos are getting grabbed as the source repo for the package in these lines:
https://github.com/wasi-master/pypi-command-line/blob/a65095fadc4fc2dcbec9e30589ff262fef9dc075/pypi_cli/__main__.py#L920-L924
pypi.org does correctly parse the GitHub info so perhaps you can grab the data there or parse it the same they do. Both the projects in question, do contain a GitHub link in their project setup.py:
https://github.com/RhetTbull/osxphotos/blob/0e9b9d625190b94c1dd68276e3b0e5367002d87c/setup.py#L60