Skip to content

fix!: dependency groups with conflict markers #154

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

robinanterior
Copy link
Contributor

@robinanterior robinanterior commented Mar 28, 2025

I was running into problems with a project with multiple separate groups and complicated conflict declarations. I made some assumptions about how uv2nix is supposed to handle that, wrote tests to codify those assumptions, then changed the code to make the tests pass.

What do you think?

uv2nix seemed to have a different behavior for uv projects which define any conflicts at all, even if unrelated to the groups you've selected, from those without conflict declarations. I think this is a bug, right? Even currently, I have some doubts about uv2nix's handling of conflict groups. It works for my use case so I've submitted the PR as-is, but I have a feeling that there are still some (valid) edge cases which could trigger problems for uv2nix. Particularly, from what I understand, conflict declarations in uv are nothing more than constraints, and a conflict checker in uv2nix should be just a satsolver, not do any actual filtering of depedencies itself: that's done by uv on creating the lock. I have a feeling that the "proper" way to handle conflicts is: only throw if the constraints are violated by the given group & extra selection, but don't let it affect dependency selection in any way.

Anyway this PR doesn't do that, but it does I think improve on the status quo (see the tests which should highlight the bugs in the current implementation, or at least what I think are bugs). Please lmk if you disagree / have other ideas around this.

@robinanterior robinanterior force-pushed the fix/dependency-group-conflicts branch from b501459 to feccd2d Compare March 31, 2025 18:44
@robinanterior
Copy link
Contributor Author

@adisbladis updated

@@ -188,7 +265,7 @@ let
};
# Check that arpeggio _isn't_ available
check = ''
! python -c "import arpeggio"
python -c "import arpeggio" && exit 1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

See the commit message for this change but I think just using ! true and relying on bash's set -e to actually exit with an error code doesn't work. 🙄 bash...

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.

1 participant