-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error creating lockfile from rendered environment #624
Comments
Thanks so much @sfinkens for the clear and easily-reproducible report! In summary, the generated - pip:
- flit-core === 3.9.0 --hash=sha256:7aada352fb0c7f5538c4fafeddf314d3a6a92ee8e2b1de70482329e42de70302 Conda-lock tries to parse this I'm wondering why pip's hash-checking mode is not part of the requirements specification defined in the dependency specifiers grammar. (That seems to be the reason it's not handled by the @sfinkens, would you be willing to look into how to resolve this and create a PR? |
@maresb Thanks for your quick reply! Sure, I'll give it a try. What strategy would you prefer? Just strip the hash or try to pass it through to where the lockfile is created? |
@sfinkens, wonderful, thanks so much! I'd prefer to pass through the lockfile hashes, and at first glance it doesn't seem like they need to travel very far. But if that proves too difficult we could also emit a clear warning and strip it. |
@maresb While debugging my example I noticed that our workflow might be too complicated. Is it correct, that conda-lock uses an existing lockfile as constraint for the next solution? For example
I tried with a simple case and that seems to work. If that's the case, I think it would be nice to mention it in the documentation. |
If there is an existing lockfile, it is indeed used when regenerating. Personally, I agree that this behavior is really confusing, and I dislike it, but I also am reluctant to change it since it may break existing workflows. I'm in the habit of always deleting I'd be very happy to accept a documentation update to make this more clear. |
Thanks for the feedback! I'll prepare a PR for the documentation. |
Checklist
What happened?
conda-lock fails to create a lockfile from a rendered environment that includes pip dependencies. To reproduce:
environment.yml
conda-lock -p linux-64 -f environment.yml
conda-lock render -p linux-64 -k env conda-lock.yml
conda-lock -p linux-64 -f conda-linux-64.lock.yml
This fails with the following traceback.
Traceback
If I remove the
--hash
option,conda-lock
succeeds.Apparently conda is able to process the file:
conda env create -f conda-linux-64.lock.yml
works fine.Conda Info
Output
Conda Config
Output
Conda list
Output
Additional Context
We use that workflow to add new packages to a lockfile while keeping existing packages as constant as possible.
The text was updated successfully, but these errors were encountered: