-
Notifications
You must be signed in to change notification settings - Fork 1
Build from Source
nepenthe is written in Python and Rust. While prebuilt wheels are provided for end users, it is also straightforward to build nepenthe from either the Python source distribution or the GitHub repository.
As a convenience, nepenthe uses a Makefile for commonly used commands. You can print the main available commands by running make with no arguments
> make
build build the library
clean clean the repository
fix run autofixers
install install library
lint run lints
test run the testsnepenthe has a few system-level dependencies which you can install from your machine package manager. Other package managers like conda, nix, etc, should also work fine.
Clone the repo with:
git clone https://github.com/Point72/nepenthe.git
cd nepentheFollow the instructions for installing Rust for your system.
Python build and develop dependencies are specified in the pyproject.toml, but you can manually install them:
make requirementsNote that these dependencies would otherwise be installed normally as part of PEP517 / PEP518.
Build the python project in the usual manner:
make buildThe nepenthe CLI can be built as a single, fully static binary (musl, no
glibc, no Python required) that runs on any Linux host. Because the dependency
tree includes C code (aws-lc-rs, zstd), the build cross-compiles the C with
zig via
cargo-zigbuild — no separate
musl C toolchain to install:
# one-time tooling (zig is pulled in as a dependency)
pip install cargo-zigbuild # or: conda install -c conda-forge cargo-zigbuild
rustup target add x86_64-unknown-linux-musl
# build it (from the rust/ directory)
cd rust
make dist-staticThis produces a statically linked, stripped binary plus np/npb symlinks:
target/x86_64-unknown-linux-musl/release/{nepenthe,np,npb}
Verify it carries no dynamic dependencies:
ldd target/x86_64-unknown-linux-musl/release/nepenthe
# => not a dynamic executableBecause nepenthe already uses rustls (not OpenSSL) throughout, the static
build needs no system TLS libraries. Override the target triple with
make dist-static MUSL_TARGET=aarch64-unknown-linux-musl for other platforms.
nepenthe has linting and auto formatting.
| Language | Linter | Autoformatter | Description |
|---|---|---|---|
| Python | ruff |
ruff |
Style |
| Python | ruff |
ruff |
Imports |
| Rust | clippy |
clippy |
Style |
| Markdown | mdformat |
mdformat |
Style |
| Markdown | codespell |
Spelling |
Python Linting
make lint-pyPython Autoformatting
make fix-pyRust Linting
make lint-rsRust Autoformatting
make fix-rsDocumentation Linting
make lint-docsDocumentation Autoformatting
make fix-docsnepenthe has both Python and JavaScript tests. The bulk of the functionality is tested in Python, which can be run via pytest. First, install the Python development dependencies with
make developPython
make test-pyRust
make test-rsThis wiki is autogenerated. To made updates, open a PR against the original source file in docs/wiki.