Closed maresb closed 1 year ago
I agree, this is really odd behavior. I think this is because for Conda source files like meta.yaml
and environment.yml
files, we need to know the list of platforms before we actually start parsing the file in order for OS preprocessor selectors to work correctly. However, as I think you suggested in https://github.com/conda/conda-lock/issues/278#issuecomment-1371407231, what we should really do is parse the source files once to get the platforms, and then parse them again to get the list of dependencies.
Since we were planning to split #316 into smaller pieces anyways, I think I can do the following to get this problem fixed first:
SourceFile
class
Checklist
What happened?
If I use both
pyproject.toml
and a supplementalenvironment.yml
as sources, and if I specify platforms inpyproject.toml
but not inenvironment.yml
, I would expect the resulting platforms to be the list frompyproject.toml
. Instead it's those platforms union the default platforms (linux-64, osx-64, win-64).The logic in
parse_source_files
looks odd to me. It seems like we add the default platforms if they are missing from any source file (except forpyproject.toml
?).I would have expected that we take the union of all platforms from all source files, and then substitute the default platforms only if that were empty.
Ping @srilman since this involves code we've been looking at recently.
Conda Info
No response
Conda Config
No response
Conda list
No response
Additional Context
No response