Skip to content

Commit 5117ada

Browse files
v0.0.5
1 parent 904f5b4 commit 5117ada

2 files changed

Lines changed: 28 additions & 5 deletions

File tree

README.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# Python CPP Boilerplate
1+
# Python C++ package boilerplate
22

3+
A minimal, cross-platform template for building Python packages with C++ extensions using pybind11.
4+
It includes a reproducible development environment, testing and linting setup, and automated multi-platform wheel building (Linux, macOS, Windows, x86_64 and arm64) via GitHub Actions.
35

46
## Compile and install the package
57

@@ -17,6 +19,25 @@ Then compile C++ bindings and install with pip
1719
.venv/bin/python -m pip install .
1820
```
1921

22+
## Install from wheel
23+
24+
Wheels are published on github, to install a compiled version of the package published on github, instead of the last command of the previous section (install from source), run this
25+
26+
```bash
27+
USER=sebastiaagramunt
28+
REPO=python-boilerplate
29+
PACKAGE_NAME=package_example
30+
PYTHON_VERSION=cp313
31+
VERSION=v0.0.5
32+
33+
# print your system, change SYSTEM variable accordingly
34+
python3 -c "import sysconfig; print(sysconfig.get_platform())"
35+
SYSTEM=macosx_11_0_arm64
36+
37+
# install from wheel
38+
.venv/bin/python -m pip install "https://github.com/${USER}/${REPO}/releases/download/${VERSION}/${PACKAGE_NAME}-${VERSION/#v/}-${PYTHON_VERSION}-${PYTHON_VERSION}-${SYSTEM}.whl"
39+
```
40+
2041
## Run an example
2142

2243
To check that this is working try importing the package and running a script
@@ -38,7 +59,7 @@ Run tests
3859
.venv/bin/mypy src
3960
```
4061

41-
## Build wheels
62+
## Build wheels locally
4263

4364
Locally you can build the wheels with
4465

@@ -66,14 +87,16 @@ In my system it creates the wheel in `dist`
6687
dist/package_example-0.0.1-cp313-cp313-linux_aarch64.whl
6788
```
6889

69-
## CI-CD for testing and wheel publishing
90+
## Build & test wheels (Github Actions CI/CD)
7091

7192
The software is tested on GitHub Actions for python versions `3.10-3.13`, architectures `x86` and `arm64` and on `ubuntu`, `macos` and `windows` operating systems. On each push in a branch the actions in `.github/workflows/build-wheels.yml` is kicked off. This action tests and publishes the wheel internally.
7293

7394
To publish the wheels just tag the release, go to master branch and check the version in `__version__` variable of `setup.py`. E.g. for the initial commit the version is `0.0.1`. Then we would run
7495

7596
```bash
76-
VERSION=0.0.1
97+
VERSION=0.0.5
7798
git tag -a v${VERSION} -m "v${VERSION}"
7899
git push origin v${VERSION}
79100
```
101+
To see the relase published in releases section on the same repository. E.g. [Tagged version v0.0.5](https://github.com/SebastiaAgramunt/python-boilerplate/releases/tag/v0.0.5)
102+

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pathlib import Path
44
import sysconfig
55

6-
__version__ = '0.0.3'
6+
__version__ = '0.0.5'
77

88
REPO_PATH = Path(__file__).resolve().parent
99

0 commit comments

Comments
 (0)