$\texttt{PyPI-Bonjour}$ 🥖
Tutorial on publishing to PyPI.
Tutorial
The pypi-bonjour package gradually adds more functionality over different versions.
v0.0.1: the hello-world example
This version publishes the barebone skeleton code to pypi, which includes:
- the source code with the single pure Python function
hello_world(in contrast with pybinded functions) - a
pyproject.tomlfile for enablingpip installof the package - the GitHub workflow that publishes the package to
pypiupon release publish
See this video by Prof.Qiusheng Wu for an introduction to PyPI packaging.
v0.0.2: add dependencies
This version adds NumPy as one of the dependencies.
v0.0.3: add pybind11-binded C++ function
This version adds a function that is pybind11-binded from C++ from Python without the use of CMake. See here for an intro regarding using pybind11 with setuptools.
See this video by anthonywritescode for an introduction to manylinux. Building these manylinux wheels requires the installation of a docker image and building the wheels inside that docker image. This process is automated by cibuildwheel. Furthermore, to enable the build for different architectures on a computer, one should download QEMU for architecture emulation
python3 -m pip install cibuildwheel
sudo apt-get install qemu-system # for Ubuntu, see https://www.qemu.org/download for more details
To build the wheels only for CPython (what is PyPy...), non-alpine Linux (what is musllinux...), x86_64 and aarch64 platforms use the following command:
export CIBW_SKIP="pp* *musllinux*"
export CIBW_ARCHS="x86_64 aarch64"
cibuildwheel
These can also be added to the pyproject.toml file
[tool.cibuildwheel]
skip = "pp* *musllinux*"
archs = "x86_64 aarch64"
Then, run cibuildwheel in the root directory. These commands will generate the built distributions in the wheelhouse directory, which can then be uploaded to PyPI using the command
twine upload wheelhouse/*
Note that the source distribution (only the source code) is still missing. To generate it and upload it to PyPI, run the commands
python3 -m build --sdist
twine upload dist/*
The final result is here. Note that the GitHub actions are not setup yet, so the action that this release triggered did not successfully upload the wheels to PyPI.
v0.0.4: added build and publish to PyPI GitHub workflow
For details see build_publish_pypi.yml.
v0.0.5: added C++ projects that are built by CMake
Added a CMakeLists.txt file to build the Python bindings using pybind11 and cmake. The setup.py file is updated according to the official pybind11 + cmake example, if you prefer a video that goes through this process see this one by Facile Tutorials.
v0.0.6: added external C++ dependencies
Added functions that uses Eigen. This involves installing Eigen in the CIBW_BEFORE_ALL script. However, there are certain limitations to CentOS that needs to be taken cared of.
Metadata
Release files for pypi-bonjour 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pypi_bonjour-0.0.6.tar.gz | 6.4 kB | Details |
Built distributions (wheels)
Total release size: 747.0 kB
Release files / pypi_bonjour-0.0.6.tar.gz
| Download URL | pypi_bonjour-0.0.6.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
07aac4ac4428e1484d8c7bdff0e8adcb1a427aa781fdf9218811b2e69a8e0faa
|
|
BLAKE2b-256 checksum How to use checksums |
547da682e3e9200d3aba5be81d08d91849a0c89b29e2a8dcbf063dcc340feabc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Release files / pypi_bonjour-0.0.6-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pypi_bonjour-0.0.6-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 64.4 kB |
| Tags | CPython 3.13 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
e5c4ec457c7223fa0866734190c745a6941ce41f4a6bb0b418b40fde5fbaa7bc
|
|
BLAKE2b-256 checksum How to use checksums |
cfe65f1bb0ba45f7cefeecb92a1571157496db2b4e754ed536265866cc28ffc7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Release files / pypi_bonjour-0.0.6-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | pypi_bonjour-0.0.6-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 59.6 kB |
| Tags | CPython 3.13 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
73443a82b1c167cd408072ecac43ec0dfc385a1e85abd8ddd7002c0420dc9485
|
|
BLAKE2b-256 checksum How to use checksums |
5b05635434b426c816b2d0eadc608a98d53c9c560fc78ce48a0c470ac198a73d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Release files / pypi_bonjour-0.0.6-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pypi_bonjour-0.0.6-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 64.4 kB |
| Tags | CPython 3.12 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
489717731d59d1cb1556199c053ba26c31aea2ae16472e8a20aed888dadd4dd7
|
|
BLAKE2b-256 checksum How to use checksums |
3a84d66bfcabb00e5bd7de7149007110987aa96f4d16d706507abc29370c053a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Release files / pypi_bonjour-0.0.6-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | pypi_bonjour-0.0.6-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 59.7 kB |
| Tags | CPython 3.12 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
068828f18641a46e29b09ce396d387052cc9e352dfe8d8be2a9616a7f18bbcfa
|
|
BLAKE2b-256 checksum How to use checksums |
b472da291c1077953f416a651323c0291dd2523ccf5e17e6ce2b27fe40076f1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Release files / pypi_bonjour-0.0.6-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pypi_bonjour-0.0.6-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 65.2 kB |
| Tags | CPython 3.11 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
7cc37e85cc3cd7970a2a8e6226fc165420e61b5edf24d9f7180389c2e1c61add
|
|
BLAKE2b-256 checksum How to use checksums |
15d6cf238e78eefc6df75b52ec98c37e75adaaf9a703d679fc097d7516e12790
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Release files / pypi_bonjour-0.0.6-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | pypi_bonjour-0.0.6-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 60.1 kB |
| Tags | CPython 3.11 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
5b3c0b66a9a172412d1ddc29be0f71a8536c4c27991f76b6d821c45baad4a575
|
|
BLAKE2b-256 checksum How to use checksums |
cda37a98690550528f045154328dd70b08248fd22057fd1f67023ce714d02070
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Release files / pypi_bonjour-0.0.6-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pypi_bonjour-0.0.6-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 63.9 kB |
| Tags | CPython 3.10 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
eabc31d69ff72c29707079f893c29f103ad23ea4ba07cc3d33052d45122b85ba
|
|
BLAKE2b-256 checksum How to use checksums |
cb4c4591a374991ae9a713d7d2bc25de95308178d77ee9d9b3edce55b0711b84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Release files / pypi_bonjour-0.0.6-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | pypi_bonjour-0.0.6-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 58.6 kB |
| Tags | CPython 3.10 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
a3410266623e34d3a213db4c7f3ea8fc327cf90ff43f20ac90fa2de18a7338b7
|
|
BLAKE2b-256 checksum How to use checksums |
783f88d9552d9be709e51f0f33f6e59b56fd66ed555a73267bd1f162498458a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Release files / pypi_bonjour-0.0.6-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pypi_bonjour-0.0.6-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 64.1 kB |
| Tags | CPython 3.9 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
44888dadd07788d416fd4ad5e17e52c91af7c28c3a41dc9a8abec00b55a46549
|
|
BLAKE2b-256 checksum How to use checksums |
dfbc1172ef7384f69e510b1f44a29a4a4da8f98e20513759733f81ef01311c81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Release files / pypi_bonjour-0.0.6-cp39-cp39-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | pypi_bonjour-0.0.6-cp39-cp39-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 58.6 kB |
| Tags | CPython 3.9 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
b2c37e04422d09cc2da831f65cb4a79d3fcfe47478d783388c40b8661d8df8ba
|
|
BLAKE2b-256 checksum How to use checksums |
534238e52faf9a48bcb848b2bb292d713d1b171c2cbb42f99b193b251d9bf642
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Release files / pypi_bonjour-0.0.6-cp38-cp38-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pypi_bonjour-0.0.6-cp38-cp38-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 63.7 kB |
| Tags | CPython 3.8 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
9986fd9c9ca2fe426c4874e0d313e431d1547bd029aabb120ed29640b7470843
|
|
BLAKE2b-256 checksum How to use checksums |
27607c12aaebdb09aa239c0c332770fd58b317f0e3ced97e28e3320a428ef0e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Release files / pypi_bonjour-0.0.6-cp38-cp38-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | pypi_bonjour-0.0.6-cp38-cp38-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 58.4 kB |
| Tags | CPython 3.8 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
7e5c99727291f0c84096db606d72620d1670f8f18f020bb2df5522b38c056b8b
|
|
BLAKE2b-256 checksum How to use checksums |
e0473960550a7fe07bd540f7b480f79c4b971e0cba23e28c0d2f1c9bbcbbca4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|