Hatch plugin for C builds
Project description
hatch-c
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`
include-numpy = false # add Numpy include paths with `numpy.get_include()`; numpy must be in `build-system.requires`
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
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
Built Distribution
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 hatch_c-0.1.0.tar.gz.
File metadata
- Download URL: hatch_c-0.1.0.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Chimera","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0883d20a3fb37caa2389210db1e40050496c4892198f1db7686d44d92e911554
|
|
| MD5 |
3d9cef3fb6d0de9812e95c6470cd7d2e
|
|
| BLAKE2b-256 |
552c5955dbc4d33c07ab27c83046880d3231f44b0bf878273db24ca707083cea
|
File details
Details for the file hatch_c-0.1.0-py3-none-any.whl.
File metadata
- Download URL: hatch_c-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Chimera","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc21503ff99954a0f9da76bc060593d9e4190228c0b8cdbf494427b624bbae4c
|
|
| MD5 |
ad583b727a79adb38561d3305f6f8f32
|
|
| BLAKE2b-256 |
e7479bbf9a04886d5166e46ba3f17ad50032ee1bb132f49eded0b716f6148f3a
|