Use kernels lock to generate a kernels.lock file that pins kernel dependencies to specific revisions.
kernels lock <project_dir>
pyproject.toml under [tool.kernels.dependencies]kernels.lock file with pinned versions and variant informationLock kernels in the current project:
kernels lock .
Lock kernels in a specific project:
kernels lock /path/to/my-project
Add your kernel dependencies to pyproject.toml:
[tool.kernels.dependencies]
"kernels-community/activation" = 1The version can be:
1, 2)The generated lock file contains:
[
{
"repo_id": "kernels-community/activation",
"sha": "ece277f908b9453112722d584fee4b5696f21c49",
"variants": {
"torch210-cu128-x86_64-windows": {
"hash": "sha256-cbf085e1d297d990d9cb074fb5079ff48e9682c729f53a0899a36b5164a6fb45",
"hash_type": "git_lfs_concat"
},
// ...
"torch29-metal-aarch64-darwin": {
"hash": "sha256-9f665b54a53246a7d3627422f8a0d41d7956dc5409043dbd14c4ec0327aea310",
"hash_type": "git_lfs_concat"
}
}
}
]pyproject.tomlkernels lock . to generate the lock filepyproject.toml and kernels.lockkernels download . to install locked kernels