Skip to main content

hatch-c

build PyPI

Very simple C build plugin for hatch, supporting CPython only.

[build-system]
requires = ["hatchling>=1.20", "hatch-c"]
build-backend = "hatchling.build"

[[tool.hatch.build.hooks.hatch-c.extension]]
name = "mypackage.mylib"
sources = ["src/module.c"]
include-dirs = ["src/"] # paths to add with `-I`
library-dirs = [] # paths to add with `-L`
libraries = [] # libraries to link with `-l` 
extra-compile-args = []
extra-link-args = []
extra-objects = []
define-macros = [] # macros to define with `-D`
undef-macros = [] # macros to undefine with `-U`
py-limited-api = "cp39"  # optional limited API to use

hatch-c is driven by pydantic models for configuration and execution of the build. These models can themselves be overridden by setting build-config-class / build-plan-class.

Other Python Build Backends for C Extensions

Acknowledgments

This project was heavily modified and stripped down from https://github.com/python-project-templates/hatch-cpp

Metadata

Release files for hatch-c 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hatch-c 0.2.2
File Size Uploaded Provenance Actions
hatch_c-0.2.2.tar.gz 11.4 kB With provenance Details for hatch_c-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hatch-c 0.2.2
File Interpreter ABI Platform Actions
hatch_c-0.2.2-py3-none-any.whl Python 3 none any Details for hatch_c-0.2.2-py3-none-any.whl

Total release size: 23.8 kB

Release files / hatch_c-0.2.2.tar.gz

Download URL hatch_c-0.2.2.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
56a52fc0376c900c71116dc3fea54dbb74effb62db1bd13cce7866c254f587e9
BLAKE2b-256 checksum
How to use checksums
e58ef2124f006ff39099f8f4c0c3f3d55e1f4ac7f00408aa1dd377e14c6f8aa8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 2, 2026.

Transparency log

Release files / hatch_c-0.2.2-py3-none-any.whl

Download URL hatch_c-0.2.2-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dfd414bc0e18868ca62db413bfeb6f8e6d2977befa9a77294a5486dcb7d956fc
BLAKE2b-256 checksum
How to use checksums
c37e01b3e7411f880dd2e3b3c9ddb4a6fa65cc533eed066f90321f03a651b97f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 2, 2026.

Transparency log

Security for hatch-c 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for hatch_c-0.2.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page