Buckets:

|
download
raw
1.71 kB
# kernels lock
Use `kernels lock` to generate a `kernels.lock` file that pins kernel dependencies to specific revisions.
## Usage
```bash
kernels lock <project_dir>
```
## What It Does
- Reads kernel dependencies from `pyproject.toml` under `[tool.kernels.dependencies]`
- Resolves each kernel to its current revision SHA
- Writes a `kernels.lock` file with pinned versions and variant information
## Examples
Lock kernels in the current project:
```bash
kernels lock .
```
Lock kernels in a specific project:
```bash
kernels lock /path/to/my-project
```
## pyproject.toml Format
Add your kernel dependencies to `pyproject.toml`:
```toml
[tool.kernels.dependencies]
"kernels-community/activation" = 1
```
The version can be:
- A version number (e.g., `1`, `2`)
## kernels.lock Format
The generated lock file contains:
```json
[
{
"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"
}
}
}
]
```
## Workflow
1. Add dependencies to `pyproject.toml`
2. Run `kernels lock .` to generate the lock file
3. Commit both `pyproject.toml` and `kernels.lock`
4. Use `kernels download .` to install locked kernels
## See Also
- [kernels download](cli-download) - Download locked kernels
- [kernels versions](cli-versions) - View available kernel versions

Xet Storage Details

Size:
1.71 kB
·
Xet hash:
71fd487c452259dc9eae6429509d35fcd25c8a68f49b50ec0e3539045ebc04dd

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.