8000 Sort BaseLockedDependency.dependencies when alpha-sorting a Lockfile by peterbygrave · Pull Request #654 · conda/conda-lock · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Sort BaseLockedDependency.dependencies when alpha-sorting a Lockfile #654

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

Merged
merged 3 commits into from
Jun 30, 2024

Conversation

peterbygrave
Copy link
Contributor
@peterbygrave peterbygrave commented Jun 28, 2024

Description

When writing a conda-lock.yml file, the package.dependencies are not sorted. This can cause more lines to change than strictly needed when e.g. adding a new package that does not alter any existing packages. This help with merge conflicts etc.

I was unsure of the ethos around testing in this repo, but very happy to add tests as needed with some guidance 🙂

Copy link
netlify bot commented Jun 28, 2024

Deploy Preview for conda-lock ready!

Name Link
🔨 Latest commit 9e5f947
🔍 Latest deploy log https://app.netlify.com/sites/conda-lock/deploys/66812da9797a1e00085b7bd1
😎 Deploy Preview https://deploy-preview-654--conda-lock.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@maresb
Copy link
Contributor
maresb commented Jun 28, 2024

Thanks! LGTM.

I don't see any need for tests here because I don't think we need to guarantee this as an interface contract.

Do you know what's leading to the unsorted dependencies? Can you provide a minimal example? In my lockfiles they're sorted. Is it coming from pip dependencies?

@peterbygrave
Copy link
Contributor Author

Thanks! LGTM.

I don't see any need for tests here because I don't think we need to guarantee this as an interface contract.

Do you know what's leading to the unsorted dependencies? Can you provide a minimal example? In my lockfiles they're sorted. Is it coming from pip dependencies?

Interesting question, I don't believe it was pip dependencies but will double check my local example where I saw it and post.

@peterbygrave
Copy link
Contributor Author

Closing and reopening to trigger ci

@peterbygrave
Copy link
Contributor Author

Thanks! LGTM.

I don't see any need for tests here because I don't think we need to guarantee this as an interface contract.

Do you know what's leading to the unsorted dependencies? Can you provide a minimal example? In my lockfiles they're sorted. Is it coming from pip dependencies?

Looking at my example (unfortunately I cannot shared due to private repo) it happens for conda packages but only when adding packages to my source environment.yaml They were quite innocent (e.g. types-networkx). The conda-lock.yml started sorted to then became unsorted but only for some packages e.g:
Screenshot 2024-06-30 at 07 19 15

Wonder if this is only happening when loading from an existing lock file. Tried looking for something obvious, but nothing stood out.

Now ready for review.

@peterbygrave peterbygrave marked this pull request as ready for review June 30, 2024 06:38
@peterbygrave peterbygrave requested a review from a team as a code owner June 30, 2024 06:38
I want to keep the models as simple as possible, and we
might as well just alphasort within the preexisting
alphasort function.
@maresb
Copy link
Contributor
maresb commented Jun 30, 2024

Thanks @peterbygrave! I made a few very minor tweaks and will squash-merge once the tests pass.

@maresb maresb merged commit ba347a0 into conda:main Jun 30, 2024
10 checks passed
romain-intel pushed a commit to romain-intel/conda-lock that referenced this pull request Sep 3, 2024
…onda#654)

Sort BaseLockedDependency.dependencies when alpha-sorting a Lockfile

Co-authored-by: Ben Mares <services-git-throwaway1@tensorial.com>
romain-intel pushed a commit to romain-intel/conda-lock that referenced this pull request Sep 3, 2024
…onda#654)

Sort BaseLockedDependency.dependencies when alpha-sorting a Lockfile

Co-authored-by: Ben Mares <services-git-throwaway1@tensorial.com>
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

Successfully merging this pull request may close these issues.

2 participants
0