astral-sh / rye

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

failed to run `rye build` if the package is a larger cargo project workspace member #1218

Open Lips7 opened 4 months ago

Lips7 commented 4 months ago

Steps to Reproduce

  1. init a project inside a cargo project
  2. include the new project as a workspace member of the cargo project
  3. run rye build

Expected Result

build as same as maturin build

Actual Result

Matcher/matcher_py on ī‚  master [!ā‡”] is šŸ“¦ v0.4.3 via šŸ v3.12.3 via šŸ¦€ v1.81.0-nightly āÆ rye build
building matcher-py

Caused by: error inheriting edition from workspace root manifest's workspace.package.edition

Caused by: failed to find a workspace root šŸ’„ maturin failed Caused by: Cargo metadata failed. Does your crate compile with cargo build? Caused by: cargo metadata exited with an error: Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/private/var/folders/2z/q88bfp8n6bz60g_sjh0_jcph0000gn/T/build-env-8wkeresb/bin/python', '--compatibility', 'off'] returned non-zero exit status 1

ERROR Backend subprocess exited when trying to invoke build_wheel error: failed to build dist

Version Info

rye 0.36.0 commit: 0.36.0 (12c024c7c 2024-07-07) platform: macos (aarch64) self-python: cpython@3.12.3 symlink support: true uv enabled: true

Stacktrace

No response

Lips7 commented 4 months ago

maybe it is because rye build command move the entire project under /private, hence, the cargo.toml couldn't be recognized correctly.