Checklist
What happened?
If an environment.yml contains both an explicit conda pin for pip and a pip: subsection, conda-lock replaces the explicit pin with pip * during solving.
Example:
name: test
channels:
- conda-forge
dependencies:
- python=3.12.1
- pip=25.0.1
- pip:
- requests
When using conda-lock it loses the 25.0.1 pin:
INFO:conda_lock.conda_solver:linux-64 using specs ['python 3.12.1.*', 'pip *']
If I remove the pip section (last two lines), then it does not lose the pin:
INFO:conda_lock.conda_solver:linux-64 using specs ['python 3.12.1.*', 'pip 25.0.1.*']
This seems like a bug --- if the environment yaml explicitly specifies a conda-side pip constraint, that constraint should be preserved.
Additional Context
For what it's worth, Pixi does not have this issue, it respects the 25.0.1 pin with and without a pip section
Checklist
What happened?
If an
environment.ymlcontains both an explicit conda pin forpipand apip:subsection,conda-lockreplaces the explicit pin withpip *during solving.Example:
When using conda-lock it loses the 25.0.1 pin:
If I remove the pip section (last two lines), then it does not lose the pin:
This seems like a bug --- if the environment yaml explicitly specifies a conda-side
pipconstraint, that constraint should be preserved.Additional Context
For what it's worth, Pixi does not have this issue, it respects the 25.0.1 pin with and without a pip section