Skip to content

fix: preserve decoration when inserting dependency#4370

Merged
ruben-arts merged 3 commits intoprefix-dev:mainfrom
baszalmstra:feature/pix-979-pixi-does-not-always-preserve-comments-in-manifest-toml-file
Aug 18, 2025
Merged

fix: preserve decoration when inserting dependency#4370
ruben-arts merged 3 commits intoprefix-dev:mainfrom
baszalmstra:feature/pix-979-pixi-does-not-always-preserve-comments-in-manifest-toml-file

Conversation

@baszalmstra
Copy link
Copy Markdown
Contributor

Fixes #4267.

Fixes an issue where the decorations (comments, newlines, etc) were not retained when pixi re-adds a dependency to the manifest file. This happens when you run pixi upgrade or pixi add with an existing dependency.

exclude-newer = "2025-05-19"

[pypi-dependencies]
click = { version = ">=8.2.0, <9", index = "https://pypi.tuna.tsinghua.edu.cn/simple" }
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is immediately an interesting case that was previously "broken". There are whitespaces in front of all the keys. These were removed previously. The new implementation retains this.

Copy link
Copy Markdown
Contributor

@ruben-arts ruben-arts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff! Can't break it!

@ruben-arts ruben-arts enabled auto-merge (squash) August 18, 2025 06:47
@ruben-arts ruben-arts disabled auto-merge August 18, 2025 06:47
@ruben-arts ruben-arts merged commit 15ea771 into prefix-dev:main Aug 18, 2025
37 of 38 checks passed
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.

Pixi does not always preserve comments in manifest toml file

2 participants