Skip to content
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

force "incompatible" version #505

Open
majidaldo opened this issue Nov 28, 2023 · 12 comments
Open

force "incompatible" version #505

majidaldo opened this issue Nov 28, 2023 · 12 comments
Labels
enhancement New feature or request

Comments

@majidaldo
Copy link

majidaldo commented Nov 28, 2023

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.

@ShravanSunder
Copy link

i too would like to this via pyproject.toml

@zanieb
Copy link
Member

zanieb commented Jun 21, 2024

We support this over in uv now. I wonder if Rye supports it if you use the uv overrides syntax in your pyproject.toml?

@ShravanSunder
Copy link

ShravanSunder commented Jun 21, 2024

@zanieb i couldn't find any docs/notes on the overrides syntax in uv. how do you define them in pyproject.toml?

@zanieb
Copy link
Member

zanieb commented Jun 21, 2024

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 = [
  "..."
]

@ShravanSunder
Copy link

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

@zanieb
Copy link
Member

zanieb commented Jun 21, 2024

Sounds like the override was applied here though?

because you require duckdb>=1.0.0 and mosaic-widget>=0.9.0,

@ShravanSunder
Copy link

i apologize, i assumed the override would force installation of that version despite the requirements being unsatisfied

@zanieb
Copy link
Member

zanieb commented Jun 21, 2024

Nope the override allows you to change the required version of a package when it is specified by a dependency in your tree.

@majidaldo
Copy link
Author

interesting developments but i'll still keep it open as what we're looking for is to force install.

@charliermarsh
Copy link
Member

Can you explain what the semantics of that would be?

@ShravanSunder
Copy link

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.

@tyree731
Copy link

Adding my use case from #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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants