force "incompatible" version
Sometimes pip(?) refuses to install a package whose version I specify in pyproject.toml creates a supposed incompatibility. Is there a way to override this? As a workaround I manually update the requirements*.txt while not specifying a version in pyproject.toml.
i too would like to this via pyproject.toml
We support this over in uv now. I wonder if Rye supports it if you use the uv overrides syntax in your pyproject.toml?
@zanieb i couldn't find any docs/notes on the overrides syntax in uv. how do you define them in pyproject.toml?
Here's an example in our test suite https://github.com/astral-sh/uv/blob/b22ee82f0d3af607cc49d3f3870805769ea0b6e6/crates/uv/tests/pip_compile.rs#L3014-L3029
Basically:
[tool.uv]
override-dependencies = [
"..."
]
i tried it and still had problems, so perhaps there's something on rye side
[tool.uv]
override-dependencies = [
"mosaic-widget>=0.9.0"
]
(askluna_py_agent_backend) ⚡➜ py-agent-backend (U feature/luna-257) rye sync
Reusing already existing virtualenv
Generating production lockfile: /Users//Documents/dev/project-dev/askluna-project/askluna/requirements.lock
× No solution found when resolving dependencies:
╰─▶ Because mosaic-widget==0.9.0 depends on duckdb==0.10.2 and
only mosaic-widget<=0.9.0 is available, we can conclude that
mosaic-widget>=0.9.0 depends on duckdb==0.10.2.
And because you require duckdb>=1.0.0 and
mosaic-widget>=0.9.0, we can conclude that the requirements
are unsatisfiable.
error: could not write production lockfile for workspace
Caused by:
Failed to run uv compile /var/folders/4f/697ggy6x26q8kh9qb2js4xnc0000gn/T/.tmphuVL7I/requirements.txt. uv exited with status: exit status: 1
Sounds like the override was applied here though?
because you require duckdb>=1.0.0 and mosaic-widget>=0.9.0,
i apologize, i assumed the override would force installation of that version despite the requirements being unsatisfied
Nope the override allows you to change the required version of a package when it is specified by a dependency in your tree.
interesting developments but i'll still keep it open as what we're looking for is to force install.
Can you explain what the semantics of that would be?
I can explain the usecase i had @charliermarsh
- duckdb upgraded to v1 major (there's no actual change for compatibility)
- one of the libs i'm using mosaic had <=0.9 requirement
- there's a ticket to update in mosaic. in the mean time i wanted to just force a version of mosaic to install.
in pnpm its a bit like resolutions where certain versions are forced to install. not sure if there's a concept of that in python managers.
Adding my use case from https://github.com/astral-sh/rye/issues/1231 here, there are a set of pyyaml which are seemingly incompatible with rye, as evidenced by this rye PR, and some dependencies of ours pull in one of those versions.