[Midnightbsd-cvs] [MidnightBSD/mports] c47321: ai/py-litellm: update to 1.102.1, convert to cargo...
Lucas Holt
noreply at github.com
Wed Sep 23 17:11:04 EDT 2026
Branch: refs/heads/master
Home: https://github.com/MidnightBSD/mports
Commit: c47321e65f624a4f87d72a7ecefeb1bd2f8ee167
https://github.com/MidnightBSD/mports/commit/c47321e65f624a4f87d72a7ecefeb1bd2f8ee167
Author: Lucas Holt <luke at foolishgames.com>
Date: 2026-09-23 (Wed, 23 Sep 2026)
Changed paths:
M ai/py-litellm/Makefile
A ai/py-litellm/Makefile.crates
M ai/py-litellm/distinfo
M ai/py-litellm/files/patch-pyproject.toml
Log Message:
-----------
ai/py-litellm: update to 1.102.1, convert to cargo + maturin (#1609)
Closes #1271.
Updates `ai/py-litellm` from 1.91.4 to 1.102.1, the current PyPI
release. From 1.92.0, upstream builds with maturin and ships a pyo3 Rust
extension (`litellm.rust_bridge._native`), so the package is no longer
pure Python. The earlier blockers, #1269 (aiohttp) and #1270 (boto3),
are both closed.
## Changes
- `USES=cargo python shebangfix`. `CARGO_CARGOTOML`/`CARGO_CARGOLOCK`
point at the `litellm-rust/` workspace, and maturin drives cargo
(`CARGO_BUILD=no`, `CARGO_INSTALL=no`, `MAKE_ENV=${CARGO_ENV}`,
`BINARY_ALIAS=python3=${PYTHON_CMD}`). This follows
`textproc/py-tokenizers`, which also has its Cargo workspace in a
subdirectory.
- `Makefile.crates` lists 411 crates, generated with `bmake
cargo-crates`. None come from git.
- `DISTFILES` is set explicitly. Otherwise the sdist gets dropped from
distinfo once cargo.mk appends the crates, same as in
`devel/py-pydantic-core`.
- `BUILD_DEPENDS`: `py-uv-build` replaced by `py-maturin`. `NO_ARCH`
dropped.
- New `LIB_DEPENDS=libonig.so:devel/oniguruma`. The extension links
against `libonig.so.5` through the tokenizers crate, and the fake QA
check flagged it (py-tokenizers declares the same dependency).
- `files/patch-pyproject.toml` rewritten. The old one patched a
`uv_build` block that no longer exists. The new one relaxes upstream's
exact `maturin==1.15.0` pin to `>=1.13` to match `devel/py-maturin`
1.13.3.
- `RUN_DEPENDS`: `aiohttp>=3.14.2<4.0`, plus new
`pydantic-settings>=2.14.1<3.0` and `boto3>=1.43.1<2.0`. Every upstream
requirement is met by the current tree versions.
- `PORTREVISION` reset.
## Testing
- `bmake makesum`: the sdist SHA256 matches PyPI, and all 412 entries
fetched.
- Clean `bmake package` passes with maturin 1.13.3 and Rust 1.95.0. It
builds `litellm-1.102.1-cp310-abi3` and the fake QA is clean.
- The native extension loads and exposes its Rust entry points
(`TokenCounter`, `chat_completions`, `messages`, `ocr`, `transcription`,
...).
- Compared with the 1.91.4 package: the same console scripts (`litellm`,
`litellm-proxy`, `lite`), and README in DOCSDIR. The only files dropped
are dev-only ones upstream's maturin config no longer ships
(`proxy/.gitignore` and `_*secret_config.yaml` samples).
- portlint: no fatal errors. The remaining warnings are the expected
DISTFILES ones.
- **Not tested:** installing the package and importing all of `litellm`,
because several runtime dependencies (openai, tiktoken, tokenizers,
fastuuid, boto3) aren't installed on the build box. Also only amd64.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
## Summary by Sourcery
Update litellm to 1.102.1 and enable packaging of its maturin-built Rust
extension.
New Features:
- Update the litellm port to the 1.102.1 release with its native Rust
extension and current runtime dependencies.
Enhancements:
- Switch the package to maturin and Cargo-based builds, including
vendored crate metadata and the required Oniguruma dependency.
- Relax the upstream maturin build requirement to match the available
port version and preserve the source distribution in distinfo.
Build:
- Replace uv-build with maturin and configure the port to build the
Rust-backed Python package through the Cargo framework.
Tests:
- Verify crate distfiles, package creation, native extension loading,
installed console scripts, documentation, and QA checks on amd64.
Signed-off-by: Lucas Holt <luke at foolishgames.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply at anthropic.com>
To unsubscribe from these emails, change your notification settings at https://github.com/MidnightBSD/mports/settings/notifications
More information about the Midnightbsd-cvs
mailing list