nvuillam / github-dependents-info

Collect information about dependencies between a github repo and other repositories. Results available in JSON, markdown and badge
https://pypi.org/project/github-dependents-info/
MIT License
114 stars 7 forks source link

WARNING:root:WARNING: Unable to get integer from "" #657

Open JamesParrott opened 3 weeks ago

JamesParrott commented 3 weeks ago

🔬 How To Reproduce

Steps to reproduce the behavior:

>pipx install github-dependents-info
>github-dependents-info --repo nvuillam/npm-groovy-lint

produces:

WARNING:root:WARNING: Unable to get integer from ""
WARNING:root:WARNING: Unable to get integer from ""
Total: 24
Public: 24 (1625 stars)
Private: -24

Environment

Windows 11, pipx 1.2.0, CPython 3.11.4

📈 Expected behavior

No warnings during normal operation, as described in the readme.

JamesParrott commented 3 weeks ago

It happens without pipx too, in a normal venv.

It is due to an intentional warning, which I personally find to be irritating and pointless. If Github's API returns an empty string instead of "0", then in my opinion empty strings and everything other value the API is likely to return, should be handled gracefully by applications built on that API.

Please change this warning to a debug message:.

https://github.com/nvuillam/github-dependents-info/blob/69ce4e67f022e67a669634d3e5a7d6c3f8d33538/github_dependents_info/gh_dependents_info.py#L482

There is no value in showing it to all users during typical execution, and it detracts from the UX.