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

"conda project add" completely override project files #174

Open
JeanChristopheMorinPerso opened this issue Nov 14, 2024 · 1 comment
Open

Comments

@JeanChristopheMorinPerso
Copy link

JeanChristopheMorinPerso commented Nov 14, 2024

Let's say I have a project file that looks like this:

dependencies:
# renovate: datasource=conda depName=main/sqlalchemy
- sqlalchemy=2.0.34
platforms:
  - linux-64
channels:
  - defaults

If I run conda project add orjson=3.10.7, the resulting file will look like

dependencies:
- sqlalchemy=2.0.34
- orjson=3.10.7
platforms:
  - linux-64
channels:
  - defaults

It stripped the comments. Not only that, but it also doesn't keep the entries sorted like the original file. This is not very convenient.

conda project add should keep the comments and the order as it is.

@AlbertDeFusco
Copy link
Contributor

I see. I'll look into if these comments can be preserved with ruamel.yaml

I think yq might support comments. Maybe a short-term fix for add is to manipulate the yaml with yq then run conda project install --force, which should re-lock since the env file changed

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