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

Add checker for PyPI packages #120

Merged
merged 2 commits into from Feb 14, 2021
Merged

Add checker for PyPI packages #120

merged 2 commits into from Feb 14, 2021

Conversation

gasinvein
Copy link
Collaborator

@gasinvein gasinvein commented Feb 11, 2021

Given PyPI package name and desired dist type (sdist or bdist_wheel), this checker finds latest available release.
Fixes #74, see test manifest for usage example.
I would appreciate a review from @nanonyme who is more familiar with PyPI and previously worked on something similar for BuildStream.

@coveralls
Copy link

coveralls commented Feb 11, 2021

Coverage Status

Coverage increased (+0.3%) to 88.356% when pulling a4baa02 on pypi-checker into 16f5fc3 on master.

@gasinvein gasinvein force-pushed the pypi-checker branch 2 times, most recently from d905842 to eb621ec Compare February 14, 2021 10:50
@nanonyme
Copy link

@gasinvein is the intent to allow wheels which contain compiled binaries?

@gasinvein
Copy link
Collaborator Author

@gasinvein is the intent to allow wheels which contain compiled binaries?

In future maybe, but currently not. It should skip all wheel with ABI.

@nanonyme
Copy link

What about compatibility? There's no guarantee pip packages are actually compatible with each other if you just update one.

@gasinvein
Copy link
Collaborator Author

gasinvein commented Feb 14, 2021

I don't think there is much we can do about it, except to provide an option for limiting suitable package versions like this:
https://github.com/flathub/flatpak-external-data-checker/blob/ffbdbfd62984637c0154a618de531cc93a7e2d87/tests/com.valvesoftware.Steam.yml#L26-L31
(== here can be replaced with <=, > and alikes)
It's not documented yet because I didn't yet figure out a future-proof schema for version constraints in checker metadata.

try:
matches = oper(StrictVersion(version), StrictVersion(ver_limit))
except ValueError:
matches = oper(LooseVersion(version), LooseVersion(ver_limit))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Iirc current version PEP is superset of this. It's probably close enough though.

@nanonyme
Copy link

Looks good to me

@gasinvein
Copy link
Collaborator Author

Hmm, AFAIK python allows only one version constraint in requirements. Maybe we should do the same? It will reduce complexity a bit.

@nanonyme
Copy link

It actually supports multiple in same line so you can declare a range.

@gasinvein
Copy link
Collaborator Author

Well then. Didn't know this, how it looks like?

@gasinvein gasinvein merged commit accd361 into master Feb 14, 2021
@gasinvein gasinvein deleted the pypi-checker branch February 14, 2021 18:20
@nanonyme
Copy link

nanonyme commented Feb 14, 2021

@gasinvein https://github.com/psf/requests/blob/master/setup.py#L45, basically you just have comma as separator.

@gasinvein
Copy link
Collaborator Author

@nanonyme And the comma does conjunction, right? If so, I guess the checker version constraints would behave more or less same as requirement notation.

@nanonyme
Copy link

Yes, indeed. Checker should work fine as is.

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.

Support updating PyPI modules
3 participants