Skip to content
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

Document (revise?) how dependencies from file sources are combined #222

Open
riccardoporreca opened this issue Jul 20, 2022 · 2 comments
Open

Comments

@riccardoporreca
Copy link
Contributor

When processing file sources, it looks like only the last specification of a conda package version (by package name) is preserved

e.g.

# environment-foo.yml
channels:
- conda-forge
dependencies:
- python=3.8.12
- numpy=1.22.3
# environment-bar.yml
channels:
- conda-forge
dependencies:
- python=3.8.12
- numpy=1.22.2
conda-lock -f environment-foo.yml -f environment-bar.yml -p linux-64
INFO:conda_lock.conda_solver:linux-64 using specs ['python 3.8.12.*', 'numpy 1.22.2.*']
conda-lock -f environment-bar.yml -f environment-foo.yml -p linux-64
INFO:conda_lock.conda_solver:linux-64 using specs ['python 3.8.12.*', 'numpy 1.22.3.*']

Is this by design? Would it be possible to resolve to the union of the specified dependencies?
The behavior, if unchanged, should be best documented in Compound specification

The relevant code seems to be

https://github.com/conda-incubator/conda-lock/blob/42923b3bd280a260f1480d45a5c7104546e44580/conda_lock/src_parser/__init__.py#L336-L346

(As a side note, it looks lines 341-342 are not effective given line 344)

@mariusvniekerk
Copy link
Collaborator

@riccardoporreca This is by design. Files specified later are intended to be overrides to the specifications earlier

@riccardoporreca
Copy link
Contributor Author

Thanks for clarifying this @mariusvniekerk, happy to draft a documentation PR if you agree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants