Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

picobuild-0.0.2.tar.gz (6.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

picobuild-0.0.2-cp314t-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (6.3 kB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

picobuild-0.0.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (6.3 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

picobuild-0.0.2-cp313t-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (6.3 kB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

picobuild-0.0.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (6.3 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file picobuild-0.0.2.tar.gz.

File metadata

  • Download URL: picobuild-0.0.2.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

Hashes for picobuild-0.0.2.tar.gz
Algorithm Hash digest
SHA256 73bd0218d98cecbc29a1eaecb9d51dcfb3792ce2fea72da8c2460c6337c1f252
MD5 79e3ce726cbe84d8d0af01eeb3a3c4d2
BLAKE2b-256 2f52b1dff74e0efc598b8654bf08e05c55028eed1083fe370049077fe73803fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for picobuild-0.0.2.tar.gz:

Publisher: python-publish.yml on picops/picobuild

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file picobuild-0.0.2-cp314t-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for picobuild-0.0.2-cp314t-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c8f228556ba488e2d19dafada7af77ca9ad2796e28888448146b5fca369afc98
MD5 43da1a3005f18552d593a269af218444
BLAKE2b-256 a4b45c383a826dc880f969132054387c605a510a9ddef3fdc8ac7073f20068f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for picobuild-0.0.2-cp314t-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on picops/picobuild

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file picobuild-0.0.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for picobuild-0.0.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9b7d81049d7ec0540187b5ccfb9f45fb6d07cfeaf5dc64f5014f6a4725dc8af8
MD5 02b7350c84654d783a4addc872b61db7
BLAKE2b-256 5a4ba0f7e541d06c765043d1c16bcd02df7e2e5f07a989a5f8642a45d48e6817

See more details on using hashes here.

Provenance

The following attestation bundles were made for picobuild-0.0.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on picops/picobuild

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file picobuild-0.0.2-cp313t-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for picobuild-0.0.2-cp313t-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ea860d1982b433f64a76b395fa1f74d9e9ef1a544276fd24db75c5ce20a47fdc
MD5 91533b166679d968caae4f48b8cb26c3
BLAKE2b-256 cbb8c7bf080beb854802d6b868791b858524fb240b016e1c160f7d7d2b03d3df

See more details on using hashes here.

Provenance

The following attestation bundles were made for picobuild-0.0.2-cp313t-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on picops/picobuild

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file picobuild-0.0.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for picobuild-0.0.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 570b52dd3cce0882eac7d473b7b18e7aea272ae938962d831da8e42b721f9588
MD5 56fbf8cda8828b20ebd4dd792249493e
BLAKE2b-256 271fd98ce4173ad9f0a5e6d08e1086ac083392ae1a1430c6af62863744b6d08e

See more details on using hashes here.

Provenance

The following attestation bundles were made for picobuild-0.0.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on picops/picobuild

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page