-
Notifications
You must be signed in to change notification settings - Fork 798
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
Conflicting general dependency and extra transitive dependency #9349
Comments
Yeah for something like this you'll need to edit the |
I think you should be able to |
I think this should fail at runtime... Since it's trying to install both conflicting groups. I consider that a bug. (Filed: #9355) |
I would expect that you need to do |
I guess we could consider (1) removing default groups that conflict when you specify |
Yeah I don't love the idea of automatically disabling default groups, though we could consider it if it's super common. It seems like the first step is a more helpful error message. |
I am also dealing with a similar issue. I have a package that depends on pytorch and I would like to always use that latest stable version when running things with It would be great if there was a way to setup the dependencies with default versions but have the ability to override all defaults with a flag. It seems like the |
Wait, actually:
|
Linux, Python version 3.10, uv version 0.5.4
I am trying to set up the following set of requirements in my team's project: I have dependency
A
for the project. I don't care what the versionA
is, but would strongly prefer it be the latest version. I would also occasionally like to use dependencyB
. DependencyB
has a transitive dependency which happens to be an old version ofA
.Specifically, the project depends on
transformers
, and I'd like to have the latest version 4.46.3. I'd occasionally like to usesalesforce-lavis.
However the latest version of this library depends ontransformers>=4.25.0,<4.27
.My goal is to be able to run my code with
transformers==4.46.3
, but if I set some flag, then it would betransformers==4.26.1
(the version that gets resolved forsalesforce-lavis
.) For example,$ uv run python >>> import transformers >>> transformers.__version__ '4.46.3'
but if I run something else, it automatically changes the version:
$ uv run --WITH_LAVIS python >>> import transformers >>> transformers.__version__ '4.26.1'
I have looked into using groups, optional dependancies, and extras. I'm not sure any of them solve what I am looking to do, and I'm wondering if there is any workaround.
The farthest I've gotten is with the following
toml
:now
uv run python
yieldstransformers==4.46.3
anduv run --only-group lavis python
yieldstransformers==4.26.1
.However there are some remaining problems with this approach:
and the desired behavior would be achieved. However to get the above
toml
I needed to manually create the base group, set it to be the default, and to not conflict with the lavis group.Even with this approach, it doesn't seem possible to upgrade
transformers
to the newest version. For example, starting with the sametoml
, but with an empty base dependency list, runninguv add --group base transformers
oruv add --group base -U transformers
installs the same old version that's already being used bysalesforce-lavis
.It doesn't seem like this approach would work if more dependencies were added outside of any group, (ie. inside
dependencies = []
.) I tried usinguv run --group lavis python
and it yieldstransformers==4.46.3
(which itself seems like a bug to me.) If limited to using--no-group
then if there is ever a new dependency that can be used by both base and lavis,uv run --only-group lavis python
will not see it.If there are any workarounds to achieve what I'm hoping to, I would greatly appreciate some direction! Thank you.
The text was updated successfully, but these errors were encountered: