Skip to main content

Hatch plugin for C builds

Project description

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`
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

hatch_c-0.1.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

hatch_c-0.1.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file hatch_c-0.1.1.tar.gz.

File metadata

  • Download URL: hatch_c-0.1.1.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hatch_c-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4bc2baa5b98226f438f61767b4b8575a1c200634c5005e235160d5b9dc193d12
MD5 4b57b75bfd3de2ae93c407591171e217
BLAKE2b-256 1d4917ef3bd22f5d63e7ea25c2b4958c3ef52f6da32914295bf7c8fd0eb89aa7

See more details on using hashes here.

Provenance

The following attestation bundles were made for hatch_c-0.1.1.tar.gz:

Publisher: build.yml on zacharyburnett/hatch-c

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

File details

Details for the file hatch_c-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: hatch_c-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hatch_c-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 41b818b900886e088efb3a6f1be69b2eaaa05f011d69c91836d311a53cce8401
MD5 ccf1572ac657a3cf19307d924f2d0e93
BLAKE2b-256 5478b12eb75769595c2a11792b7e73555c6162b3c3f86546f29f3e70ac70f85a

See more details on using hashes here.

Provenance

The following attestation bundles were made for hatch_c-0.1.1-py3-none-any.whl:

Publisher: build.yml on zacharyburnett/hatch-c

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