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

Source distribution (sdist) contains source files and the whole project directory itself as a nested folder #2383

Open
2 tasks done
jeertmans opened this issue Dec 13, 2024 · 0 comments
Labels
bug Something isn't working sdist Source distribution

Comments

@jeertmans
Copy link

Bug Description

Hello!

When analyzing the source distribution of my Rust/Python package, named differt-core, I noticed that the content of .tar.gz was as follows:

> tree -L dist/differt_core-0.0.30/
dist/differt_core-0.0.30/
├── Cargo.lock
├── Cargo.toml
├── differt-core  # <-- I want to exclude this, as this is duplicate (and undesired) contents
│   ├── benches
│   ├── Cargo.toml
│   ├── LICENSE.md
│   ├── python
│   ├── README.md
│   ├── src
│   └── tests
├── LICENSE.md
├── PKG-INFO
├── pyproject.toml
├── python
│   └── differt_core
├── README.md
└── src
    ├── geometry
    ├── lib.rs
    ├── rt
    └── scene

As you can see, the python folder (with Python source files) is included both ./ and ./differt-core, and I don't know how to exclude this (because this is not needed to build from source): I tried various exclude patterns, without success.

I have looked at other projects, and found that py-polars had the same "issue" in that its source distribution also contains the project folder itself.

However, projects like uv do not have this issue.

The main observed difference between uv and my project (as well as py-polars) is that uv is defined in the root directory, whereas my project (and py-polars) are defined in a subdirectory.

Do you have any idea how to fix this?

Thanks in advance for your help!

Relevant links:

Your maturin version (maturin --version)

1.7.8

Your Python version (python -V)

N/A

Your pip version (pip -V)

N/A

What bindings you're using

pyo3

Does cargo build work?

  • Yes, it works

If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)?

  • Yes

Steps to Reproduce

You can either download the source distribution from the above links, or build from source with either:

maturin sdist --out dist --manifest-path differt-core/Cargo.toml

or with uv:

uv build --package differt-core --sdist -o dist

Next, open the archive.

@jeertmans jeertmans added the bug Something isn't working label Dec 13, 2024
@messense messense added the sdist Source distribution label Dec 15, 2024
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

No branches or pull requests

2 participants