[X] I searched open reports and couldn't find a duplicate
What happened?
With the following environment.yml file I have found that the input-hash to be unstable in that repeated runs of conda lock change the input hash and thereby force a re-lock of the dependencies.
Here are repeated runs of conda lock where you'll see the hashes change. Sometimes they are stable for several runs and sometimes they change every time.
I will submit a PR shortly that can protect against this case by ensuring that the extras field is sorted in the conda_lock.models.lock_spec._BaseDependency pydantic model.
Conda Info
active environment : base
active env location : /Users/adefusco/Applications/miniconda3
shell level : 1
user config file : /Users/adefusco/.condarc
populated config files : /Users/adefusco/.condarc
conda version : 23.5.0
conda-build version : 3.23.3
python version : 3.9.13.final.0
virtual packages : __archspec=1=arm64
__osx=13.4=0
__unix=0=0
base environment : /Users/adefusco/Applications/miniconda3 (writable)
conda av data dir : /Users/adefusco/Applications/miniconda3/etc/conda
conda av metadata url : None
channel URLs : https://repo.anaconda.com/pkgs/main/osx-arm64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/osx-arm64
https://repo.anaconda.com/pkgs/r/noarch
https://conda.anaconda.org/anaconda-cloud/osx-arm64
https://conda.anaconda.org/anaconda-cloud/noarch
https://conda.anaconda.org/conda-forge/osx-arm64
https://conda.anaconda.org/conda-forge/noarch
package cache : /Users/adefusco/Applications/miniconda3/pkgs
/Users/adefusco/.conda/pkgs
envs directories : /Users/adefusco/Applications/miniconda3/envs
/Users/adefusco/.conda/envs
platform : osx-arm64
user-agent : conda/23.5.0 requests/2.28.1 CPython/3.9.13 Darwin/22.5.0 OSX/13.4
UID:GID : 502:20
netrc file : None
offline mode : False
I've looked at the arguments in https://github.com/conda/conda-lock/issues/432. As the maintainer of conda-project I find value in having the hash in the conda-lock file. The use case is that a user creates a project with locked dependencies. When they re-visit the project several years later conda project install will check that the hash is still valid and install the packages as they were rather than re-lock before installing. But if the environment.yml had changed the user will be shown a warning.
Checklist
What happened?
With the following environment.yml file I have found that the input-hash to be unstable in that repeated runs of
conda lock
change the input hash and thereby force a re-lock of the dependencies.Here are repeated runs of
conda lock
where you'll see the hashes change. Sometimes they are stable for several runs and sometimes they change every time.I have traced the problem down to
pkg_resources
I will submit a PR shortly that can protect against this case by ensuring that the
extras
field is sorted in theconda_lock.models.lock_spec._BaseDependency
pydantic model.Conda Info
Conda Config
Conda list
Additional Context
I've looked at the arguments in https://github.com/conda/conda-lock/issues/432. As the maintainer of conda-project I find value in having the hash in the conda-lock file. The use case is that a user creates a project with locked dependencies. When they re-visit the project several years later
conda project install
will check that the hash is still valid and install the packages as they were rather than re-lock before installing. But if the environment.yml had changed the user will be shown a warning.