You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
End-user installs work via:
pip install quantcpp
Changes:
- bindings/python/setup.py: bundle quant.h into quantcpp/_quant.h at
sdist time so installs from a published tarball don't need ../../quant.h.
Force platform-tagged wheel via _BinaryDistribution.has_ext_modules.
- bindings/python/pyproject.toml: bump 0.5.0 → 0.8.0, drop deprecated
license classifier (PEP 639), add cibuildwheel config for Linux x86_64/
aarch64, macOS Intel+arm64, Windows AMD64. requires-python >= 3.9.
- bindings/python/quantcpp/__init__.py: read __version__ from
importlib.metadata (single source of truth = pyproject.toml).
- bindings/python/MANIFEST.in: include quantcpp/_quant.h in sdist.
- bindings/python/.gitignore: never commit bundled header / built libs.
- .github/workflows/publish.yml: cibuildwheel matrix + sdist + OIDC
Trusted Publishing to PyPI on tag push (no API token needed).
Manual workflow_dispatch supports TestPyPI as well.
Local verification (clean venv, no source tree):
pip install dist/quantcpp-0.8.0.tar.gz → libquant.dylib auto-builds
pip install dist/quantcpp-...-arm64.whl → libquant.dylib pre-built
python -c "import quantcpp; from quantcpp._binding import get_lib;
print(get_lib().quant_version().decode())"
→ "0.1.0 (quant.h single-header)"
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: bindings/python/README.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,16 +5,17 @@ Python bindings for [quant.cpp](https://github.com/quantumaikr/quant.cpp) -- a m
5
5
## Installation
6
6
7
7
```bash
8
-
cd quant.cpp/bindings/python
9
-
pip install .
8
+
pip install quantcpp
10
9
```
11
10
12
-
This compiles `quant.h`into a shared library automatically using your system C compiler (`cc`, `gcc`, or `clang`). No external dependencies required.
11
+
Pre-built wheels are published for Linux (x86_64, aarch64), macOS (Intel + Apple Silicon), and Windows (x64). On other platforms pip falls back to the source distribution and compiles `quant.h` automatically using your system C compiler — no external dependencies.
# Verify the bundled header is in place before building
60
+
before-build = "python -c \"import shutil, os; src='../../quant.h'; dst='quantcpp/_quant.h'; (os.path.exists(src) and shutil.copyfile(src, dst)) or (os.path.exists(dst) or (_ for _ in ()).throw(FileNotFoundError(dst)))\""
0 commit comments