Python bindings for libcdoc via SWIG. Produces installable wheels for reading and writing encrypted CDOC containers.
libcdoc/— upstream C++ library as a git submodulepatches/libcdoc-python.patch— adds Python typemaps, templates, and director support to upstreamlibcdoc.iCMakeLists.txt— applies patch, builds upstream statically, then builds SWIG Python moduleswig/pycdoc.i— thin wrapper:%renamefor snake_case +%include "libcdoc.i"src/pycdoc/__init__.py— re-exports SWIG symbols, provides high-levelencrypt()API
- Static linking (
BUILD_SHARED_LIBS=OFF) — self-contained wheels, LGPL-2.1 compliance via RELINKING.md + sdist source - Patch-based approach — upstream libcdoc.i is modified via
patches/libcdoc-python.patchat CMake configure time (rather than forking) - SWIG
%renamebefore%include— order matters, rename rules must appear before upstream interface is included
uv sync --dev
uv run pytest tests/ -v# System deps (Ubuntu): libssl-dev libxml2-dev zlib1g-dev flatbuffers-compiler libflatbuffers-dev
uv build --wheelUses scikit-build-core as the build backend bridging CMake. Requires C++23, SWIG 4.0+, CMake 3.20+.
Never use git -C <path> — always run git commands from the working directory.
.github/workflows/build.yml — 5 jobs:
build— every push, Ubuntu only (quick feedback)test— runs pytest against the built wheelbuild_wheels— on release/PR, cibuildwheel v3.3.1 across Linux/macOS/Windowsbuild_sdist— on release/PRpublish— OIDC trusted publishing to PyPI
Linux wheels build OpenSSL 3.5 LTS and flatbuffers from source inside manylinux_2_28 with GCC 13.
bump-my-version configured in pyproject.toml. Updates version in pyproject.toml, __init__.py, and CMakeLists.txt, commits, and tags.