astral-sh / rye

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

Invalid lock file generated #1340

Closed pperanich closed 1 month ago

pperanich commented 1 month ago

Steps to Reproduce

  1. unzip attached example project pkg-1.zip
  2. run rye sync

Oddly enough, if you pin the python version to 3.11 or above, this error does not occur.

Expected Result

Valid requirements lock files are generated.

Actual Result

error: Couldn't parse requirement in `requirements-dev.lock` at position 24635
  Caused by: Expected a valid marker name, found ''
exceptiongroup==1.2.2 ; python_version < '3.11' and (python_version < '3.8' or python_version >= '3.11' or platform_machine != 'loongarch64' or platform_python_implementation == 'PyPy' or (python_version < '3.13' and python_version >= '3.12') or (platform_machine == 'loongarch64' and platform_python_implementation != 'PyPy') or (platform_machine == 'loongarch64' and platform_python_implementation != 'PyPy' and ()))

Version Info

rye 0.38.0 commit: 0.38.0 (3e3c8540f 2024-08-02) platform: macos (aarch64) self-python: cpython@3.12.4 symlink support: true uv enabled: true

Stacktrace

stack backtrace:
   0: std::backtrace::Backtrace::create
   1: anyhow::error::<impl anyhow::Error>::msg
   2: rye::uv::UvWithVenv::sync
   3: rye::sync::sync
   4: rye::cli::sync::execute
   5: rye::cli::execute
   6: std::panicking::try
   7: rye::utils::panic::trap_bad_pipe
   8: rye::main
   9: std::sys_common::backtrace::__rust_begin_short_backtrace
  10: std::rt::lang_start::{{closure}}
  11: std::rt::lang_start_internal
  12: _main
charliermarsh commented 1 month ago

Fairly certain this is fixed in newer versions of uv

charliermarsh commented 1 month ago

I can upgrade and cut a new release today, probably.

pperanich commented 1 month ago

Yep, just built and ran rye from main branch and it is fixed.

pperanich commented 1 month ago

Slightly off topic, but are there any notable rye features missing from uv at this point? I was reading through the documentation and it appears that there is (experimental) project support that looks almost identical to rye.