astral-sh / rye

a Hassle-Free Python Experience
https://rye.astral.sh
MIT License
13.6k stars 466 forks source link

Bad dependency parsing of asyncpraw #1263

Open spott opened 2 months ago

spott commented 2 months ago

Steps to Reproduce

In a new directory:

rye init .
rye add crawlee --features playwright --no-sync   
rye add asyncpraw      

The python version is cpython@3.11.9.

Expected Result

Install both crawlee[playwright] and asyncpraw at the same time.

If I use uv, and I use a requirements.in file of:

crawlee[playwright]
asyncpraw

then uv venv && uv pip compile --python-version 3.11 requirements.in installs both packages without any issues.

Actual Result

This results in:

λ › rye init .                                                                                                     
success: Initialized project in /Users/spott/code/my_code/hadrian/test/.
  Run `rye sync` to get started
λ › rye add crawlee --features playwright --no-sync                                                           
Initializing new virtualenv in /Users/spott/code/my_code/hadrian/test/.venv
Python version: cpython@3.11.9
Added crawlee[playwright]>=0.1.1 as regular dependency
λ › rye add asyncpraw                                                                                         
Added asyncpraw>=7.7.1 as regular dependency
Reusing already existing virtualenv
Generating production lockfile: /Users/spott/code/my_code/hadrian/test/requirements.lock
  × No solution found when resolving dependencies:
  ╰─▶ Because only crawlee<=0.1.1 is available and crawlee==0.1.1 depends on aiofiles>=23.2.1,<24.0.0, we can conclude that
      crawlee>=0.1.1 depends on aiofiles>=23.2.1,<24.0.0.
      And because asyncpraw==7.7.1 depends on aiofiles<1 and only asyncpraw<=7.7.1 is available, we can conclude that
      asyncpraw>=7.7.1 and crawlee>=0.1.1 are incompatible.
      And because you require crawlee>=0.1.1 and asyncpraw>=7.7.1, we can conclude that the requirements are unsatisfiable.

      hint: Pre-releases are available for crawlee in the requested range (e.g., 0.1.2b2), but pre-releases weren't enabled
      (try: `--prerelease=allow`)
error: could not write production lockfile for project

Caused by:
    Failed to run uv compile /var/folders/z1/lqb9k5rx74b8c7xswlv9g7580000gn/T/.tmpirSO8a/requirements.txt. uv exited with status: exit status: 1

Version Info

rye 0.36.0 commit: 0.36.0 (1980-01-01) platform: macos (aarch64) self-python: cpython@3.11.9 symlink support: true uv enabled: true