Warning
Always check the repository for latest readme information.
Rustbin provides rustup and all of its proxies cargo, rustc.. (1) (2) in a convenient python package.
# After installation
$ tree .venv
.venv
βββ bin
β βββ cargo
β βββ rustc
β βββ rustup-init
(...)β Also check out Rustman, for python methods, easy cross compilation, management and automation!
Note: This is a community repackaging effort with no affiliation to the Rust project.
Rustbin is available on PyPI and can be added to your pyproject.toml or pip installed directly:
[project]
dependencies = ["rustbin"]Versioning of the package will follow:
- Same as rustup, without rushes to match all upstream releases (at least a month stable).
- Broken releases might be deleted and re-uploaded as 'post' within a week, if needed.
- New platforms might be added post-release at any time, and with no version bump.
- Ancient versions might be removed to save space, in case a size grant is not given.
Important
As mapping system information from Python/Wheels to a Rust Triple is non-trivial, and that the package needs rust to build from source, attempting to pip install on "unknown" platforms without prebuilt wheels on pypi will make an empty one from source without rustup or shims.
Your best path is to install rustup externally in such cases, this package essentially becomes a no-op.
Open issues to tell interest in platforms that are actually used, so the package doesn't balloon in size!
Rustbin bundles a small (rust) program to spawn shims faster than [project.scripts] ever could:
β Less than a millisecond overhead, compared to ~105ms for a python script
# Note: /bin/cargo is effectively a zero-cost symlink
$ RUSTUP_FORCE_ARG0=cargo hyperfine /bin/rustup
Time (mean Β± Ο): 30.6 ms Β± 0.8 ms [User: 21.5 ms, System: 8.9 ms]
Range (min β¦ max): 29.5 ms β¦ 36.0 ms 100 runs
# Shims calling .venv/bin/rustup-init
$ hyperfine .venv/bin/cargo
Time (mean Β± Ο): 31.2 ms Β± 0.4 ms [User: 21.7 ms, System: 9.2 ms]
Range (min β¦ max): 30.5 ms β¦ 32.7 ms 100 runsNote: Full benchmark command was nice -20 taskset -c 2 hyperfine -w 50 -r 100 -N (command)
Rustbin is dual-licensed under the MIT or Apache-2.0 license, at your option.