Skip to main content

very simple C build plugin for hatch, supporting CPython only

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`
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.2.0.tar.gz (11.4 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.2.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hatch_c-0.2.0.tar.gz
  • Upload date:
  • Size: 11.4 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.2.0.tar.gz
Algorithm Hash digest
SHA256 305832866eb0b6b91c4ace27aabc5e5578bf9f67ab04906b0760b791580aba21
MD5 aa584d1f2738434235a0e7ec82a4eda6
BLAKE2b-256 afe5a3331acff4b151465e807b40d8c86488ab6097db3e835d8987067126783a

See more details on using hashes here.

Provenance

The following attestation bundles were made for hatch_c-0.2.0.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: hatch_c-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.4 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f775892e53098dd580c2366303a9b8692a54bbe9dd35936676b203f9c51f4eb6
MD5 2033ac1f4889f12ba03d069e2bb5f59a
BLAKE2b-256 b2f0d6d62f7cf84845395ed83fe811603083e323d6fa2c0e6de91aa9af43c978

See more details on using hashes here.

Provenance

The following attestation bundles were made for hatch_c-0.2.0-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