langsmith-pyo3 0.1.0rc5


pip install langsmith-pyo3

  Latest version

Released: Dec 13, 2024

Project Links

Meta
Requires Python: >=3.9

Classifiers

Programming Language
  • Rust
  • Python :: Implementation :: CPython
  • Python :: Implementation :: PyPy

langsmith-pyo3

Python bindings for LangSmith internals.

Development

Requires a recent Rust build. rustup upgrade stable should do it.

Relies on maturin, uvx, and cargo-nextest.

To bootstrap, run:

cargo install --locked cargo-nextest
uv venv --seed
source .venv/bin/activate
pip install patchelf

To develop, run uvx maturin develop which will build and install the Rust code directly into the current virtualenv.

To build wheels, run uvx maturin build.

To make performance-optimized builds, append --release to either command.

To run install these bindings into another virtualenv (e.g. to run benchmarks), activate that virtualenv, then cd to this directory and run uvx maturin develop --release. When that command completes, the virtualenv will have an optimized build of langsmith-pyo3 installed.

Testing

Do not run cargo test, IT WILL NOT WORK. You will get an inscrutable linker error like undefined symbol: _Py_CheckFunctionResult or linker command failed with exit code 1.

Instead, run: cargo nextest run --no-default-features

TL;DR on why:

  • This package assumes it's compiled into a Python library, but Rust tests don't run a Python environment. That won't work.
  • The --no-default-features flag is configured to include Python into the built code, which Rust tests will then run. (Full details here.)
  • Rust tests run in parallel, but Python and orjson assume they own the entire process. That won't work.
  • cargo nextest lets us run each test in its own process, satisfying Python's and orjson's assumptions.

Wheel compatibility matrix

Platform CPython 3.9 CPython 3.10 CPython 3.11 CPython 3.12 CPython 3.13
macosx_11_0_arm64
manylinux_2_28_aarch64
manylinux_2_28_x86_64
musllinux_1_2_aarch64
musllinux_1_2_x86_64
win_amd64

Files in release

langsmith_pyo3-0.1.0rc5-cp310-cp310-macosx_11_0_arm64.whl (2.1MiB)
langsmith_pyo3-0.1.0rc5-cp310-cp310-manylinux_2_28_aarch64.whl (2.4MiB)
langsmith_pyo3-0.1.0rc5-cp310-cp310-manylinux_2_28_x86_64.whl (2.5MiB)
langsmith_pyo3-0.1.0rc5-cp310-cp310-musllinux_1_2_aarch64.whl (2.6MiB)
langsmith_pyo3-0.1.0rc5-cp310-cp310-musllinux_1_2_x86_64.whl (2.6MiB)
langsmith_pyo3-0.1.0rc5-cp310-cp310-win_amd64.whl (1.9MiB)
langsmith_pyo3-0.1.0rc5-cp311-cp311-macosx_11_0_arm64.whl (2.1MiB)
langsmith_pyo3-0.1.0rc5-cp311-cp311-manylinux_2_28_aarch64.whl (2.4MiB)
langsmith_pyo3-0.1.0rc5-cp311-cp311-manylinux_2_28_x86_64.whl (2.5MiB)
langsmith_pyo3-0.1.0rc5-cp311-cp311-musllinux_1_2_aarch64.whl (2.6MiB)
langsmith_pyo3-0.1.0rc5-cp311-cp311-musllinux_1_2_x86_64.whl (2.6MiB)
langsmith_pyo3-0.1.0rc5-cp311-cp311-win_amd64.whl (1.9MiB)
langsmith_pyo3-0.1.0rc5-cp312-cp312-macosx_11_0_arm64.whl (2.1MiB)
langsmith_pyo3-0.1.0rc5-cp312-cp312-manylinux_2_28_aarch64.whl (2.4MiB)
langsmith_pyo3-0.1.0rc5-cp312-cp312-manylinux_2_28_x86_64.whl (2.5MiB)
langsmith_pyo3-0.1.0rc5-cp312-cp312-musllinux_1_2_aarch64.whl (2.6MiB)
langsmith_pyo3-0.1.0rc5-cp312-cp312-musllinux_1_2_x86_64.whl (2.6MiB)
langsmith_pyo3-0.1.0rc5-cp312-cp312-win_amd64.whl (1.9MiB)
langsmith_pyo3-0.1.0rc5-cp313-cp313-macosx_11_0_arm64.whl (2.1MiB)
langsmith_pyo3-0.1.0rc5-cp313-cp313-manylinux_2_28_aarch64.whl (2.4MiB)
langsmith_pyo3-0.1.0rc5-cp313-cp313-manylinux_2_28_x86_64.whl (2.4MiB)
langsmith_pyo3-0.1.0rc5-cp313-cp313-musllinux_1_2_aarch64.whl (2.6MiB)
langsmith_pyo3-0.1.0rc5-cp313-cp313-musllinux_1_2_x86_64.whl (2.6MiB)
langsmith_pyo3-0.1.0rc5-cp39-cp39-macosx_11_0_arm64.whl (2.1MiB)
langsmith_pyo3-0.1.0rc5-cp39-cp39-manylinux_2_28_aarch64.whl (2.4MiB)
langsmith_pyo3-0.1.0rc5-cp39-cp39-manylinux_2_28_x86_64.whl (2.5MiB)
langsmith_pyo3-0.1.0rc5-cp39-cp39-musllinux_1_2_aarch64.whl (2.6MiB)
langsmith_pyo3-0.1.0rc5-cp39-cp39-musllinux_1_2_x86_64.whl (2.6MiB)
langsmith_pyo3-0.1.0rc5-cp39-cp39-win_amd64.whl (1.9MiB)
langsmith_pyo3-0.1.0rc5.tar.gz (1.9MiB)
No dependencies