Skip to content

Conversation

@danieldk
Copy link
Member

@danieldk danieldk commented Jan 13, 2026

This change adds support for kernel versions branches as implemented by kernel-builder:

  • kernels upload will upload the branch corresponding to the kernel's version.
  • get_kernel, LayerRepository, etc. accept version branches through the version argument.
  • Kernel locking (e.g. kernels lock) support reading version branches from pyproject.yaml and correctly locking them.

All the kernel functions and layers already supported a version argument for version specifiers (based on tags). These are now overloaded -- if version is a str, it is parsed as a version specifier. If it is an int, it is used as a version branch.

This overloading is used to gradually move to version branches, deprecating version specifiers. For now, using version specifiers will emit a warning.

This change adds support for kernel versions branches as
implemented by `kernel-builder`:

* `kernels upload` will upload the branch corresponding to the
  kernel's version.
* `get_kernel`, `LayerRepository`, etc. accept version branches
  through the `version` argument.
* Kernel locking (e.g. `kernels lock`) support reading version
  branches from `pyproject.yaml` and correctly locking them.

All the kernel functions and layers already supported a `version`
argument for version specifiers (based on tags). These are now
overloaded -- if `version` is a `str`, it is parsed as a version
specifier. If it is an `int`, it is used as a version branch.

This overloading is used to gradually move to version branches,
deprecating version specifiers. For now, using version specifiers
will emit a warning.
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@danieldk danieldk marked this pull request as ready for review January 16, 2026 15:31
Co-authored-by: Mohamed Mekkouri <93391238+MekkCyber@users.noreply.github.com>
MekkCyber
MekkCyber previously approved these changes Jan 20, 2026
drbh
drbh previously approved these changes Jan 20, 2026
Copy link
Collaborator

@drbh drbh left a comment

Choose a reason for hiding this comment

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

looks good just small nits!

@danieldk danieldk dismissed stale reviews from drbh and MekkCyber via 8b92b29 January 22, 2026 15:23
Get the full name by using the path in `kernels versions`.
@danieldk danieldk merged commit 6dfe59c into main Jan 23, 2026
38 checks passed
@danieldk danieldk deleted the version-option branch January 23, 2026 10:16
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.

5 participants