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

maturin build --sdist: README.md was already added for workspace crate #2244

Closed
1 task done
mhils opened this issue Oct 2, 2024 · 7 comments · Fixed by #2262
Closed
1 task done

maturin build --sdist: README.md was already added for workspace crate #2244

mhils opened this issue Oct 2, 2024 · 7 comments · Fixed by #2262
Assignees
Labels
bug Something isn't working sdist Source distribution

Comments

@mhils
Copy link
Contributor

mhils commented Oct 2, 2024

Bug Description

With a README file both in the workspace root and the crate root:

building a source distribution fails:

$ cd mitmproxy-rs
$ RUST_LOG=maturin=debug maturin build --sdist
2024-10-02T14:12:48.035925Z DEBUG into_build_context: maturin::project_layout: Found pyproject.toml in working directory at "/Users/mhils/git/mitmproxy_rs/mitmproxy-rs/pyproject.toml"
2024-10-02T14:12:48.037519Z DEBUG into_build_context: maturin::project_layout: Using cargo manifest path from working directory: "/Users/mhils/git/mitmproxy_rs/mitmproxy-rs/Cargo.toml"
2024-10-02T14:12:48.037891Z DEBUG into_build_context:resolve_cargo_metadata: maturin::project_layout: Resolving cargo metadata from "/Users/mhils/git/mitmproxy_rs/mitmproxy-rs/Cargo.toml"
2024-10-02T14:12:48.247759Z  INFO into_build_context:resolve_cargo_metadata: maturin::project_layout: close time.busy=210ms time.idle=1.25µs
2024-10-02T14:12:48.248315Z DEBUG into_build_context: maturin::project_layout: Project layout resolved project_root=/Users/mhils/git/mitmproxy_rs/mitmproxy-rs python_dir=/Users/mhils/git/mitmproxy_rs/mitmproxy-rs rust_module=/Users/mhils/git/mitmproxy_rs/mitmproxy-rs/mitmproxy_rs python_module=/Users/mhils/git/mitmproxy_rs/mitmproxy-rs/mitmproxy_rs extension_name=mitmproxy_rs module_name=mitmproxy_rs
🍹 Building a mixed python/rust project
🔗 Found pyo3 bindings with abi3 support for Python ≥ 3.10
2024-10-02T14:12:48.340243Z DEBUG into_build_context:check_executable: maturin::python_interpreter: Found CPython interpreter at /Users/mhils/git/mitmproxy/venv/bin/python executable=python
2024-10-02T14:12:48.340263Z  INFO into_build_context:check_executable: maturin::python_interpreter: close time.busy=49.0ms time.idle=1.83µs executable=python
🐍 Not using a specific python interpreter
📡 Using build options features from pyproject.toml
2024-10-02T14:12:48.340320Z  INFO into_build_context: maturin::build_options: close time.busy=305ms time.idle=1.50µs
2024-10-02T14:12:48.388449Z DEBUG maturin::source_distribution: Found path dependencies: ["mitmproxy"]
2024-10-02T14:12:48.388466Z DEBUG maturin::source_distribution: Found sdist root: /Users/mhils/git/mitmproxy_rs
2024-10-02T14:12:48.388469Z DEBUG maturin::source_distribution: Adding path dependency: mitmproxy at /Users/mhils/git/mitmproxy_rs/Cargo.toml
[...]
2024-10-02T14:12:48.503569Z DEBUG maturin::module_writer: Adding mitmproxy_rs-0.10.1.dev0/LICENSE from /Users/mhils/git/mitmproxy_rs/LICENSE
2024-10-02T14:12:48.503663Z DEBUG maturin::module_writer: Adding mitmproxy_rs-0.10.1.dev0/README.md from /Users/mhils/git/mitmproxy_rs/README.md
[...]
2024-10-02T14:12:48.664433Z DEBUG maturin::source_distribution: Rewriting Cargo.toml `package.readme` at /Users/mhils/git/mitmproxy_rs/mitmproxy-rs/Cargo.toml
2024-10-02T14:12:48.664452Z DEBUG maturin::source_distribution: Rewriting Cargo.toml `workspace.members` at /Users/mhils/git/mitmproxy_rs/mitmproxy-rs/Cargo.toml
[...]
2024-10-02T14:12:48.664641Z DEBUG maturin::module_writer: Adding mitmproxy_rs-0.10.1.dev0/mitmproxy-rs/README.md from /Users/mhils/git/mitmproxy_rs/mitmproxy-rs/README.md
[...]
2024-10-02T14:12:48.667225Z DEBUG maturin::module_writer: Adding mitmproxy_rs-0.10.1.dev0/mitmproxy-rs/stubtest-allowlist.txt from /Users/mhils/git/mitmproxy_rs/mitmproxy-rs/stubtest-allowlist.txt
💥 maturin failed
  Caused by: Failed to build source distribution
  Caused by: File mitmproxy_rs-0.10.1.dev0/README.md was already added from /Users/mhils/git/mitmproxy_rs/README.md, can't added it from /Users/mhils/git/mitmproxy_rs/mitmproxy-rs/README.md

Cargo.toml, mitmproxy-rs/Cargo.toml, and mitmproxy-rs/pyproject.toml do not specify any (custom) settings w.r.t. READMEs. I would have expected maturin to use mitmproxy-rs/README.md and not README.md.

This is a regression that started in 1.7.1. Refs #2184 and #2154.

Your maturin version (maturin --version)

1.7.4

Your Python version (python -V)

3.12

Your pip version (pip -V)

all

What bindings you're using

pyo3

Does cargo build work?

  • Yes, it works
@mhils mhils added the bug Something isn't working label Oct 2, 2024
@messense messense added the sdist Source distribution label Oct 3, 2024
@deadsoul44
Copy link

What is ETA for this? (no pressure intended)

chrjabs added a commit to chrjabs/rustsat that referenced this issue Oct 14, 2024
chrjabs added a commit to chrjabs/rustsat that referenced this issue Oct 14, 2024
konstin added a commit that referenced this issue Oct 17, 2024
The test crate still needs to be wired up

Fixes #2244
@konstin konstin self-assigned this Oct 17, 2024
@mhils
Copy link
Contributor Author

mhils commented Oct 18, 2024

Thank you, @konstin! 😃 🍰

remi-dupre added a commit to remi-dupre/opening-hours-rs that referenced this issue Oct 28, 2024
remi-dupre added a commit to remi-dupre/opening-hours-rs that referenced this issue Oct 28, 2024
remi-dupre added a commit to remi-dupre/opening-hours-rs that referenced this issue Oct 28, 2024
remi-dupre added a commit to remi-dupre/opening-hours-rs that referenced this issue Oct 28, 2024
remi-dupre added a commit to remi-dupre/opening-hours-rs that referenced this issue Oct 28, 2024
AnBowell added a commit to AnBowell/whittaker-eilers that referenced this issue Nov 27, 2024
@AnBowell
Copy link

I managed to run into this issue running on the bug-fixed v1.7.5

Found maturin version requirement maturin>=1.0,<2.0 specified in pyproject.toml
Found maturin release from manifest: v1.7.5

...

💥 maturin failed
  Caused by: Failed to build source distribution
  Caused by: File whittaker_eilers-0.2.0/README.md was already added from /home/runner/work/whittaker-eilers/whittaker-eilers/README.md, can't added it from /home/runner/work/whittaker-eilers/whittaker-eilers/whittaker-eilers-py/README.md

I reverted back to v1.6.0 and it was working once again.

I did double check and this issue was fixed in #2262 and mentioned in the v1.7.5 release but it seems like the issue is still present.

@kemingy
Copy link

kemingy commented Nov 28, 2024

I also encounter this issue with version v1.7.5 if I have

[project]
readme = "README.md"

in the pyproject.toml.

@deadsoul44
Copy link

Is this fixed on v1.7.7?

@Systemcluster
Copy link

I'm still seeing the issue with version 1.7.8 in https://github.com/Systemcluster/kitoken/tree/main/packages/python. 1.6.0 works here as well.

@konstin I think this issue shouldn't be closed.

@deadsoul44
Copy link

deadsoul44 commented Dec 18, 2024

I opened a new issue for this. Give a thumbs up.

#2358

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sdist Source distribution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants