-
Notifications
You must be signed in to change notification settings - Fork 107
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
incorrect install command suggested in conda-lock.yml comments with 'dev' extra dependencies #641
Comments
@mariusvniekerk, is there any reason not to deprecate all the And I think we should readd |
Hi, |
Thanks @qmarcou for the reminder! I think this fix should be straightforward. Would you be interested in submitting a PR? |
I could try to give it a go.
The scope of commands that would be altered is: install, lock, render and render-lock-spec (in a nutshell, all conda-lock subcommands) |
Hi @qmarcou, your last message somehow disappeared from my inbox. 🤦 Yes, your description is correct. That would be amazing. And perfect for a breaking change to include in v3. |
Hi @maresb , Should I keep the current So what should I aim for? Most sensible defaults or CLI consistency? |
Oof, I hadn't thought of this. Thanks for explaining. Unfortunately I don't have any answers now. I hope we can discuss our way through this one. I originally envisioned this as something as simple as From the user perspective, I think we should strive to make it as easy as possible to migrate from breaking changes. For example, I like the idea of deprecating an argument and failing with an error of how to switch to its direct replacement argument. If someone is maintaining some workflow, and we need to break it, then I'd like for them to have a 5-minute fix.
I'm concerned that with this approach, some users may potentially suddenly inherit a bunch of new extras after upgrading conda-lock, introducing weird constraints coming from the extra dependencies, possibly rendering the environment unsolvable. To spell out the situation as I understand:
I'm realizing now that this is tangent to the duplicated I think the default behavior of
|
I'll first draft something along the simple Regarding the the extras default behavior, I think you have it all perfectly summed up. Though I agree with the fact that adding all extras by default by may lead to unsolvable environments I think I have a different view on this. The way I see the conda-lock workflow is: For me this workflow makes most sense when extra spices do not require to change the core of the recipe/environment. E.g. I may want to have a core computing environment to run my scientific code, have development extra with linters/formatters etc, an extra with security scanning (e.g with |
Thanks @qmarcou for the thoughtful response. I think I agree with you, but I'm not sure I've understood:
What exactly do you mean here by "change the core of the recipe/environment"? Even with your example I still don't understand what the "change" is. I would like to adjust the defaults, and I think would make most sense to lock all the extras by default. The upcoming release is way bigger than I wanted because i delayed it due to mamba v2. For that reason, for this particular release I want to postpone any breaking changes that may have weird side-effects (like changing the input dependencies to the So if we change which dependencies are included by default, let's target that for conda-lock v4 instead of v3. As long as v3 goes smoothly, I don't see any reason to wait long to release v4. |
Hi @maresb apologies for the late reply.
channels:
- conda-forge
dependencies:
# Core dependencies
- python and channels:
- conda-forge
category: my_extras
dependencies:
- python <=3.12
- jake # scan dependencies for known security issues Solving using In my opinion the current default for extras encourages to lock twice, once with On the other hand adding all extras by default makes everything much clearer in my opinion: conda-lock lock --files env1.yml env2.yml
conda-lock render --kind explicit --extras my_extras --filename-template conda-{platform}-withextras.lock
conda-lock render --kind explicit --filename-template conda-{platform}-core.lock # all packages from in this env are contained in the previous one I can start with deprecating |
One more specific question, dev information could be used to create the lockfile name template but not extras, should I add support for a similar functionality with generic extras or just deprecate? See conda-lock/conda_lock/conda_lock.py Lines 1347 to 1386 in df4280c
and conda-lock/conda_lock/conda_lock.py Lines 516 to 528 in df4280c
|
@qmarcou, I'm having trouble reproducing this claim (both on conda-lock lock --file env_core.yml --file env_extra.yml -p linux-64 --lockfile=lock-without-extras.yml
conda-lock lock --file env_core.yml --file env_extra.yml -p linux-64 --extras my_extras --lockfile=lock-with-extras.yml
md5sum lock-with-extras.yml
cat lock-without-extras.yml | sed s/lock-without-extras.yml/lock-with-extras.yml/g | md5sum The checksum shows that the two lockfiles are identical (up to the filenames appearing in the metadata). The lockfile lists Python 3.12.0. |
Ooww sorry I had not tested that example. conda-lock lock --file env_core.yml --file env_extra.yml -p linux-64 --lockfile=lock-without-extras1.yml
conda-lock lock --file env_core.yml -p linux-64 --lockfile=lock-without-extras2.yml This is just to test whether my example is ill-chosen, or if solving with extra categories but without using Thanks for this check! |
The two commands you just provided lead to very different results because the second command doesn't know about |
Ok, then I guess I am misunderstanding something. Assuming the default behavior of
, and I do not understand how changing the Given this:
Is the |
I think I might see what the confusion is. The "extra" terminology comes from the PyPI metadata as defined in So what I originally thought you meant is that if you run |
Thanks for the context, I did not have time to dig into this misunderstanding just yet. I will get back to you about this. In the meantime I have submitted a first batch of changes to deprecate all --dev switches. As mentioned in the PR, there is no automated test to assert this deprecation functions as expected yet. It seems there were already no tests to regarding |
I should have provided more context. The "extras" terminology comes from:
Thus it's sort of an outdated PyPI-centric terminology for categories. For this reason, in qmarcou#2 I'm aiming to prefer the |
Checklist
What happened?
After building a lock file from a pyproject.toml with optional dependencies named 'dev':
conda-lock --extras dev -f pyproject.toml --mamba
withpyproject.toml
being:the conda-lock.yml header displays incorrect install information:
which fails
Both :
conda-lock install --dev -n YOURENV conda-lock.yml
andconda-lock install -e dev -n YOURENV conda-lock.yml
work, any of these two commands should be suggested instead.I guess these lines should be deleted (if the
-e
option is prefered) or updated:conda-lock/conda_lock/lockfile/__init__.py
Lines 193 to 199 in fcb8d53
When using any other name than
dev
(e.gfoo
) for extras the correct command is suggested :conda-lock install -e foo -n YOURENV conda-lock.yml
Conda Info
Conda Config
# nothing
Conda list
No response
Additional Context
This is in between documentation and bug issue and I wasn't sure how to assign it. This is also somewhat related to #255 .
The text was updated successfully, but these errors were encountered: