Closed link2xt closed 1 year ago
git-cliff
is another Rust package that uploads binaries to PyPI now: https://github.com/orhun/git-cliff/pull/158
This is mentioned in 1.3.0 release notes: https://git-cliff.org/blog/1.3.0/
As deltachat-rpc-server
is not usable by itself, I think we need to split this issue into "package deltachat-rpc-server on npm" and "package deltachat-rpc-server on PyPI", so Node.js client can depend on the first one and deltachat-rpc-client
can depend on the second one without the user need to know anything about deltachat-rpc-server binary existing.
EDIT: opened an issue for npm packaging: #4694
Zig provides ziglang
package at https://pypi.org/project/ziglang/
Source code is at https://github.com/ziglang/zig-pypi
What is interesting is that wheels are built directly using a small script.
Made a PR to repackage binaries as Python wheels: #4831 Going to upload them to PyPI for the next core release.
deltachat-rpc-server is installable with pip
now: https://pypi.org/project/deltachat-rpc-server/
npm is tracked in #4694
Installation of async Python bindings includes installation of
deltachat-rpc-server
binary anddeltachat-rpc-client
Python package. Installingdeltachat-rpc-server
involves downloading the correct binary from the Releases page into~/.local/bin
, renaming it intodeltachat-rpc-server
, setting executable permission and adding~/.local/bin
toPATH
. After that user needs to installdeltachat-rpc-client
Python bindings from source.This installation process will improve with #4216 and #4523, but is still far from the simplicity of
pip install deltachat
.One example of a Rust project that distributes the binary via PyPI is ruff. It is installable via
pip install ruff
.Unfortunately, PyPI does not allow uploading wheels with a simple
linux_x86_64
platform tag anymore even though our binaries are statically linked against musl libc and work on any Linux regardless of whether it is a glibc-based distribution, musl-based distribution or an Android phone runningdeltachat-rpc-server
in Termux. ruff project builds manylinux binaries using maturin-action GitHub Action which involves building ARM wheels in QEMU or using manylinux-cross Docker images to build glibc binaries. If we go this way and upload the binary to PyPI, we can either build manylinux binaries or just upload the same wheel with multiple platform tags.Another distribution option is
npm
. esbuild package Go binaries to npm. Primary package https://www.npmjs.com/package/esbuild runs the script which downloads actual binary package like https://www.npmjs.com/package/@esbuild/linux-arm64 If we package tonpm
, we do not necessarily need to split packages and can make a single package that distributes Linux, Windows and macOS binary. This is how prebuildify works, so it seems to be acceptable in JavaScript world to download Windows binaries when you install on Linux and vice versa.Third option is to make a script that downloads the correct binary from GitHub, similar to rustup. Binary hashes can be built into the script. It can also be built into
__main__.py
ofdeltachat-rpc-client
so thatdeltachat-rpc-server
is installable viapython -m deltachat_rpc_client
or something like this.Fourth option is
cargo-binstall
but its usage is very limited as you needcargo-binstall
to be installed already.