-
Notifications
You must be signed in to change notification settings - Fork 19
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
Prevent channel/dependency reordering when rendering the environment #203
Conversation
Thanks @wolny, Can you please come up with a test for this, to avoid a regression in the future? Thanks |
Testing should include screaming out loud when there are conflicting orderings of channels or pip dependencies. We probably should allow opting-in for this to happen and give a best order when this would not matter (e.g., when using newer pip versions with dependency resolution or when disabling channel priority in conda). |
for more information, see https://pre-commit.ci
Hi @nicoddemus, I've added a single test which checks the ordering of channels and pip dependencies. Cheers! |
Question, does this keeps the order for all dependencies, or just channels/pip dependencies? |
this change in fact prevents reordering of dependencies: https://github.com/ESSS/conda-devenv/blob/master/src/conda_devenv/devenv.py#L500 this line was responsible for reordering dependencies and I've change the |
I see, thanks for clarifying. Technically we should not need to preserve the order of the normal/conda dependencies, and sorting them actually has the benefit of making the diff smaller in case someone changes the order in their devenv files for any reason -- but anyways the generated Thanks for the PR! I will leave this open for a few days to given others the chance to review it. |
@nicoddemus yes, the order of dependencies does not matter for conda, since it computes the resolution on the whole set of dependencies. However the order of channels and pip dependencies does matter as mentioned in #117 and should be preserved. Channel ordering is already preserved by |
Thank you. |
Keeps the order of channels/pip dependencies as defined in
environment.devenv.yml
(fixes #117).In the current version the rendering of the following:
is incorrect:
This PR prevents the reordering and generate the correct outcome: