spl:migrate-catalog
One off. Move everything splent_catalog held into the two places that
now hold it.
Usage
splent spl:migrate-catalog [--dry-run]
Requires detached mode.
Options
| Option | Description |
|---|---|
--dry-run |
Show what would be written without writing anything. |
What the catalog was, and what replaced it
splent_catalog was one git repository holding a .gitignore and a
handful of metadata.toml files, because the models themselves were
gitignored and lived on UVLHub. Its only real job was mapping an SPL name
to a DOI, which made it a hard dependency of every workspace and of every
deployment that had to resolve a model.
Two things that already had to exist do that job now.
- The DOI, which each product records in its own
pyproject.tomlunder[tool.splent.spl_model], so a product resolves its model with nothing but its own repository and UVLHub. - The model file, which lives in a working copy at
splent_spl_<name>/while it is being edited and in.splent_cache/spls/while it is merely being used.
What the command does
For each SPL the catalog describes.
- Copies its model file, when one is on disk, into
.splent_cache/spls/so nothing has to be downloaded to keep working offline. - Writes its DOI into every product that names that SPL, under
[tool.splent.spl_model].
An SPL with no DOI recorded is left alone and reported, with the suggestion to publish it. A product that already records the same DOI is skipped.
It never deletes the catalog directory. It is your repository, it may hold uncommitted work, and removing it is a decision for a human with git in hand. The command says as much when it finishes.
Until it has run
A workspace that predates the pin has no product carrying a
[tool.splent.spl_model] block, so nothing in it can resolve a model.
That is the default state of every workspace created before this change,
so the commands you reach for first name the fix instead of only reporting
the symptom. spl:list, spl:info and
product:validate all point back here.
Example
splent spl:migrate-catalog
spl:migrate-catalog
cms_spl
doi 10.5281/zenodo.21610307
model cached at /workspace/.splent_cache/spls/cms_spl@10.5281_zenodo.21610307/cms_spl.uvl
pin recorded in innosoft_app/pyproject.toml
pin recorded in diversolab_app/pyproject.toml
cached 1 model(s), pinned 2 product(s).
splent_catalog/ was not touched. Nothing in the CLI reads it any more.