online-ml/river

Cannot build from source (sdist) from PyPI.

ccoulombe opened this issue ยท 4 comments

Versions

river version: latest (0.21.0)
Python version: all supported
Operating system: does not matter

Describe the bug

Build from an sdist will fail since the Cargo.toml file required does not exists in the sdist.
It does in the github repository.

Steps/code to reproduce

pip wheel --no-deps --no-build-isolation . -vv river
...
error: can't find manifest for Rust extension `river.stats._rust_stats` at path `Cargo.toml`

Alternative

Building from the repository works :

pip wheel --no-deps --no-build-isolation git+https://github.com/online-ml/river.git@0.21.0

Hi there,

After a quick glance into the problem, it seems like the switch to poetry might be the culprit here (this is a hypothesis). Poetry overlook the MANIFEST.in file, which is necessary for specifying additional files needed in the sdist, like the Cargo.toml file for Rust extensions. Here's what's currently in the MANIFEST.in:

cat MANIFEST.in
global-include *.cpp
global-include *.pyx
global-include *.pxd
include river/datasets/*.csv
include river/datasets/*.gz
include river/datasets/*.zip
include river/stream/*.zip
include Cargo.toml
recursive-include rust_src *

Because of this shift to poetry, the Cargo.toml file isn't making it into the sdist, which is why building river from the sdist fails. For a fix, we need to move all these includes into the pyproject.toml file. Poetry manages package building through pyproject.toml, not MANIFEST.in, so we have to ensure everything we need is specified there.

I will try to test this fix this afternoon.

@ccoulombe This pull request #1506 should fix your issue, thanks for pointing it out ๐Ÿ˜„

Issue Fixed we can close it ๐Ÿ˜„