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

Method used to check cvdupdate version in PyPI is unsupported #66

Open
steve-mays opened this issue Nov 18, 2024 · 4 comments
Open

Method used to check cvdupdate version in PyPI is unsupported #66

steve-mays opened this issue Nov 18, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@steve-mays
Copy link

steve-mays commented Nov 18, 2024

I've noticed in the log file for cvdupdate.py the following:

2024-11-17 11:28:57 PM - DEBUG:  Checking for a newer version of cvdupdate.
2024-11-17 11:28:58 PM - WARNING:  You are running cvdupdate version: 1.1.2.
2024-11-17 11:28:58 PM - WARNING:  There is a newer version on PyPI: requirement:'cvdupdate==random':Expectedendorsemicolon(afternameandnovalidversionspecifier. Please update!

The method used in cvdupdate.py to check the installed and latest versions of the cvdupdate package uses a technique described in https://stackoverflow.com/questions/58648739/how-to-check-if-python-package-is-latest-version-programmatically. However, this no longer works with versions of pip 24.1b1 onwards.

This is documented in pypa/pip#12852

An alternative could be to use pip index versions cvdupdate and parse the result.

@micahsnyder
Copy link
Contributor

Thanks for the heads up and the proposed fix.

@micahsnyder micahsnyder added the bug Something isn't working label Nov 19, 2024
@steve-mays
Copy link
Author

No worries @micahsnyder - I could do a pull request with a fix unless you're already picking this up?

@micahsnyder
Copy link
Contributor

TBH I'm somewhat scrambling on another project right now. I would love if you're up for making a pull request, @steve-mays 🙏

@steve-mays
Copy link
Author

Another option would be to query the PyPI JSON API directly https://pypi.org/pypi/cvdupdate/json to get the latest version. We could also remove the dependency on the deprecated pkg_resources module in favour of importlib.metadata as per https://setuptools.pypa.io/en/latest/pkg_resources.html.

I'll create a PR shortly 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants