Building tools for CPython extensions
Project description
picobuild
Building tools for CPython extensions (Cython, setuptools) and standalone executables.
Install
pip install picobuild
Or with uv:
uv add picobuild
Quick start
setuptools + Cython
Re-export of setuptools’ Extension, find_packages, and setup, plus a Cython build dir that stays out of the way of the main build:
from Cython.Build import cythonize # or use picobuild.cythonize
from picobuild import Extension, get_cython_build_dir, setup
extensions = cythonize(
[Extension("mypkg.foo", ["src/mypkg/foo.pyx"])],
build_dir=get_cython_build_dir(),
)
setup(ext_modules=extensions, ...)
Or use picobuild’s cythonize, which sets the build dir for you:
from picobuild import Extension, cythonize, setup
extensions = cythonize([Extension("mypkg.foo", ["src/mypkg/foo.pyx"])])
setup(ext_modules=extensions, ...)
Standalone executable from Python
Build a single-file executable from a Python script (Cython --embed + gcc):
from picobuild import build_cython_executable
build_cython_executable("hello.py", "bin/hello")
Or with parameters:
from picobuild import ExecutableParameters, build_cython_executable
params = ExecutableParameters("script.py", build_dir="bin", executable_name="myapp")
build_cython_executable(params._source_file, params._executable_file)
API
| Name | Description |
|---|---|
Extension |
setuptools Extension (for Cython/C extensions). |
find_packages |
setuptools find_packages. |
setup |
setuptools setup. |
get_cython_build_dir(build_dir="build") |
Path like build/cython.linux-x86_64-cpython-313 for Cython output. |
cythonize(*args, **kwargs) |
Cython’s cythonize with build_dir set via get_cython_build_dir. |
build_cython_executable(source_file, dest_file=None) |
Build a standalone executable from a .py file. |
ExecutableParameters(source_file, build_dir, executable_name=None) |
Parameters for the executable build. |
Docs
Full API and usage: Sphinx documentation (or build locally with make docs).
Development
make sync # uv sync --extra dev
make install-uv # sync + editable install
make test # unittest
make check # isort, black, flake8, mypy
make docs # Sphinx HTML in docs/_build/html
License
BSD-3-Clause.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file picobuild-0.1.0.tar.gz.
File metadata
- Download URL: picobuild-0.1.0.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae8671485f0b0128a0b8bcbb6ba3b13763cc10c31ab3e537429e0556a04fe1bd
|
|
| MD5 |
22ea9fe8b6c829ab76760bfe623ff5df
|
|
| BLAKE2b-256 |
3c92a4e922873cae6ae9798b02af3edcf3829072ed12fa1eb9a2b193f57c22c8
|
Provenance
The following attestation bundles were made for picobuild-0.1.0.tar.gz:
Publisher:
python-publish.yml on picops/picobuild
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
picobuild-0.1.0.tar.gz -
Subject digest:
ae8671485f0b0128a0b8bcbb6ba3b13763cc10c31ab3e537429e0556a04fe1bd - Sigstore transparency entry: 946057484
- Sigstore integration time:
-
Permalink:
picops/picobuild@718240a8e318026505791ad479ec17eeb08ed8b6 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/picops
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@718240a8e318026505791ad479ec17eeb08ed8b6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file picobuild-0.1.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: picobuild-0.1.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 6.3 kB
- Tags: CPython 3.14, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d96a5e96308d69bdb93ffe57aaac4d7c9dfce9a68dc856648dcb76fbce57a0b
|
|
| MD5 |
d8354deedf47f0d7757284b1eea9df8d
|
|
| BLAKE2b-256 |
10783eda4e4b7c6b170d7c8af85cbc95c9d6ff393849c34855cdfe6e8a88179e
|
Provenance
The following attestation bundles were made for picobuild-0.1.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
python-publish.yml on picops/picobuild
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
picobuild-0.1.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
9d96a5e96308d69bdb93ffe57aaac4d7c9dfce9a68dc856648dcb76fbce57a0b - Sigstore transparency entry: 946057500
- Sigstore integration time:
-
Permalink:
picops/picobuild@718240a8e318026505791ad479ec17eeb08ed8b6 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/picops
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@718240a8e318026505791ad479ec17eeb08ed8b6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file picobuild-0.1.0-cp313t-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: picobuild-0.1.0-cp313t-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 6.3 kB
- Tags: CPython 3.13t, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51c203a0b0c112161221b1f5a62f5a543ef912b11cf77dd819e40b5207e9a1e3
|
|
| MD5 |
6f296e2729380fdb1cf13835339c3767
|
|
| BLAKE2b-256 |
cf1976e5e3e61ad1a84af228ec7410d71a4260434f4805c882293461a4a8222b
|
Provenance
The following attestation bundles were made for picobuild-0.1.0-cp313t-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
python-publish.yml on picops/picobuild
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
picobuild-0.1.0-cp313t-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
51c203a0b0c112161221b1f5a62f5a543ef912b11cf77dd819e40b5207e9a1e3 - Sigstore transparency entry: 946057490
- Sigstore integration time:
-
Permalink:
picops/picobuild@718240a8e318026505791ad479ec17eeb08ed8b6 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/picops
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@718240a8e318026505791ad479ec17eeb08ed8b6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file picobuild-0.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: picobuild-0.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 6.3 kB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebe2bffc71b8d99636b96b7eead9d7cdee78e6157b97a0de20ae7c8eb189c1cf
|
|
| MD5 |
78cb7523876c1c0fb9566fb3931444fb
|
|
| BLAKE2b-256 |
94de008779a36e2bc5877f4c0f6959ff9029add674d15189c77afe8bf9d54b6f
|
Provenance
The following attestation bundles were made for picobuild-0.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
python-publish.yml on picops/picobuild
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
picobuild-0.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
ebe2bffc71b8d99636b96b7eead9d7cdee78e6157b97a0de20ae7c8eb189c1cf - Sigstore transparency entry: 946057493
- Sigstore integration time:
-
Permalink:
picops/picobuild@718240a8e318026505791ad479ec17eeb08ed8b6 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/picops
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@718240a8e318026505791ad479ec17eeb08ed8b6 -
Trigger Event:
release
-
Statement type: