Search code examples
pythonrustpypireadmepyo3

PyO3-Maturin publish command doesn't upload Readme and License to PyPi


I've a built a rust-python project and published it to PyPi using Maturin. The project is structured like the example on the maturin readme with the addition of the License file:

my_project
├── Cargo.toml
├── my_project
│   ├── __init__.py
│   └── bar.py
├── Readme.md
├── LICENSE
└── src
    └── lib.rs

When I use maturin publish the readme and license files aren't uploaded to pypi.

I'd like to also publish the readme and license files on PyPi and can't find any info on how to do that using maturin, or just separately add the missing files to PyPi...

I would appreciate any info on how to get the readme and license files to PyPi


Solution

  • Pretty late to the party, but for future reference, you can include these files in the source distribution when using maturin, by adding the following to pyproject.toml.

    [tool.maturin]
    sdist-include = ["LICENSE", "Readme.md"]
    

    I see that you don't have a pyproject.toml in yours, not sure if this is due to an older version of maturin or what, but that's the up-to-date way at least.