-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
robinanterior
wants to merge
9
commits into
pyproject-nix:master
Choose a base branch
from
cohelm:fix/dependency-group-conflicts
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
fix!: dependency groups with conflict markers #154
robinanterior
wants to merge
9
commits into
pyproject-nix:master
from
cohelm:fix/dependency-group-conflicts
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bash is a nightmare: $ ( set -e ; echo y ; false ; echo n ) y $ ( set -e ; echo y ; true ; echo n ) y n $ ( set -e ; echo y ; ! false ; echo n ) y n It gets worse: $ f () { echo y ; false ; echo n ; } $ ( set -e ; f ) y $ ( set -e ; ! f ) y n Avoid, lol. 🥲
b501459
to
feccd2d
Compare
@adisbladis updated |
robinanterior
commented
Mar 31, 2025
@@ -188,7 +265,7 @@ let | |||
}; | |||
# Check that arpeggio _isn't_ available | |||
check = '' | |||
! python -c "import arpeggio" | |||
python -c "import arpeggio" && exit 1 |
There was a problem hiding this comment.
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.