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

Accept version specifications for kernels in pyproject.toml #11

Merged
merged 2 commits into from
Jan 22, 2025

Conversation

danieldk
Copy link
Member

We lock the highest compatible version. Until we have a better mechanism, tags of the form vX.Y.Z are recognized as versions. The versions are locked by their git commit SHA.

We lock the highest compatible version. Until we have a better
mechanism, tags of the form `vX.Y.Z` are recognized as versions.
The versions are locked by their git commit SHA.
https://packaging.python.org/en/latest/specifications/version-specifiers/#version-specifiers
"""
versions = _get_available_versions(repo_id)
requirement = SpecifierSet(version_spec)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems to be accepting a lot more that pure version specifiers.

https://packaging.python.org/en/latest/specifications/version-specifiers/#direct-references

But seems to convenient to pass on for now :).
Do you happen to know if it also supports the "extensions" (not sure about the proper terminology) "0.1.0; python_version> '3.9'"

Copy link
Member Author

Choose a reason for hiding this comment

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

Seems like they are called markers, but they are only parsable when using Requirement, but that also includes the package name, etc.:

https://packaging.pypa.io/en/latest/requirements.html

I think we could easily support this in the future if we want to (by stubbing the package name and then parsing everything as a requirement).

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was thinking reducing what we accept for now (just about controlling the actual surface of what people will try to do and the errors they receive).

But again no need to reinvent the wheel here.

@danieldk danieldk merged commit e05ba73 into main Jan 22, 2025
3 checks passed
@danieldk danieldk deleted the kernel-versions branch January 22, 2025 12:10
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.

2 participants