Open wolfv opened 2 years ago
We should probably also include a field for the schema version so that we can recognize when the lockfile's consumer needs to be updated.
Definitely. Luckily there's https://github.com/conda-incubator/conda-lock/blob/7d9bd6d67d59fdd30d92a2ace3ee344aafa6a2b1/conda_lock/src_parser/lockfile.py#L79
Thanks @jvansanten, I just noticed that. (I was looking in the metadata
section, not the top-level.)
I was rather surprised that my lock file needed to end with -lock.yaml
to work, and the error message was not helpful to me:
critical libmamba Invalid spec, no package name found:
A better error message or more intelligent parsing of the yaml file to detect it is a lock file would be useful.
@wholtz, there have also been complaints about this on the conda-lock side (https://github.com/conda-incubator/conda-lock/pull/280). Probably the strategy there will be to first attempt to parse as yaml (for new style) and on failure fall back to parsing as explicit ( = old style).
I was rather surprised that my lock file needed to end with
-lock.yaml
to work
I was surprised recently in the opposite respect: when I try to install from a standard environment YAML formatted "lock file" (without hashes) generated with conda env export | grep -v "^prefix" > environment-lock.yml
, micromamba complains that the file is in the wrong format. This file is accepted by mamba
and conda
with no issues.
critical libmamba YAML parsing error while reading environment lockfile located at '/tmp/environment-lock.yml' : invalid node; first invalid key: "version"
I work around this by renaming the file, but this was still surprising to not be able to install from a file following standard environment YAML format if it has a certain naming pattern.
It would be great to have a new lockfile format. The current conda lockfile format (explicit env format) has quite a bunch of shortcomings: it's a weird ad-hoc format and only supports MD5 sums (and not even by default, I think & SHA256 is much better). The command to export an explicit environment in conda is
conda list --explicit [--md5]
Micromamba already improves on this by changing the command to
micromamba env export --explicit [--no-md5]
(ie. it uses theenv
subcommand and defaults to add--md5
hashes).I am thinking it would be nice to replace this with a proper YAML based format.
I am proposing something like:
The explicit packages would contain a list per (supported) subdir. The list would be the full env resolution (including noarch pacakges) and in the correct order for installation (as current lockfiles today).