feat: add Python bindings with PyPI publishing#6
Conversation
Implement the full public API layer over UniFFI-generated _lowlevel bindings: Format enum with extension/can_encode/from_path/from_bytes, Image and Result classes, Resize/Crop/Extend namespace helpers, and public functions (open, decode, convert, crop, extend, resize, optimize, optimize_file). All 75 tests pass.
Summary of ChangesHello @clroot, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly expands the utility of the Highlights
Changelog
Ignored Files
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
maturin develop requires a virtualenv which wasn't set up in CI. Switch to maturin build + pip install which works with system Python.
- Add input validation: quality (0-100), Image buffer size, fill tuple channel ranges (0-255) - Consistent exception handling: optimize_file now raises SlimgError instead of FileNotFoundError for I/O errors - Add smoke test and version check jobs to publish workflow - Complete SlimgError variant list in README documentation - Add 14 new validation tests (89 total) - Add performance note to resize_image docstring
- Export resize() in slimg-ffi following the same pattern as crop/extend - Remove PNG encode/decode workaround from Python resize_image() - Regenerate Kotlin bindings with new resize function - Add 6 resize tests for Kotlin bindings
- Update all Cargo.toml, pyproject.toml, gradle.properties - Update Kotlin README: fix outdated version (0.1.2 → 0.3.1), add missing crop/extend/resize docs, complete error variant list
Summary
pip install slimg)slimg.open(),slimg.convert(),slimg.crop(),slimg.resize(),slimg.extend(),slimg.optimize()등 15개 public APIbindings = "uniffi"모드로 기존slimg-ffi크레이트 재사용python-bindings.yml(3 OS × 2 Python 버전 빌드 & 테스트)publish.yml에 PyPI 배포 통합 (5 플랫폼 wheel + sdist, Trusted Publisher)Test plan
🤖 Generated with Claude Code