Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

hatch-simple-cython

PyPI - Version PyPI - Python Version GitHub GitHub Workflow Status

A minimalist Hatch plugin for building Cython extensions, optimized for uv projects.

Features

  • Zero-config - Auto-discovers and compiles .pyx files
  • Simple - Focused on core functionality without complex configuration
  • Full Cython support - Compiler directives, include directories, and linking options
  • uv-friendly - Perfect integration with uv workflow

Installation

uv add --dev hatch-simple-cython

Quick Start

Add to your pyproject.toml:

[build-system]
requires = ["hatchling", "hatch-simple-cython", "Cython>=3.0.0", "setuptools"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel.hooks.simple-cython]

That's it! The plugin will automatically discover and compile your .pyx files.

Configuration

Basic Example

[tool.hatch.build.targets.wheel.hooks.simple-cython]
directives = { language_level = "3", boundscheck = false }
compile_args = ["-O3"]
include_dirs = ["include"]
compile_py = false  # Only compile .pyx files by default

NumPy Support

[tool.hatch.build.targets.wheel.hooks.simple-cython]
include_numpy = true

All Options

Option Type Default Description
directives dict {language_level: 3} Cython compiler directives
compile_args list[str] ["-O2"] Compiler arguments
link_args list[str] [] Linker arguments
include_dirs list[str] [] Include directories
libraries list[str] [] Libraries to link
library_dirs list[str] [] Library search directories
define_macros list [] Preprocessor macro definitions
compile_py bool false Compile .py files
include_numpy bool false Include NumPy headers
cythonize_kwargs dict {} Additional cythonize() kwargs

Examples

See the examples/ directory for complete example projects:

  • pure_python/ - Compiling .py files to binary extensions
  • simple_example/ - Basic Cython usage with .pyx files
  • numpy_example/ - Cython with NumPy integration

MIT License

See LICENSE file for details.

Metadata

Release files for hatch-simple-cython 0.1.0b3

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-simple-cython 0.1.0b3
File Size Uploaded Provenance Actions
hatch_simple_cython-0.1.0b3.tar.gz 126.4 kB Without provenance Details for hatch_simple_cython-0.1.0b3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hatch-simple-cython 0.1.0b3
File Interpreter ABI Platform Actions
hatch_simple_cython-0.1.0b3-py3-none-any.whl Python 3 none any Details for hatch_simple_cython-0.1.0b3-py3-none-any.whl

Total release size: 135.2 kB

Release files / hatch_simple_cython-0.1.0b3.tar.gz

Download URL hatch_simple_cython-0.1.0b3.tar.gz
Size 126.4 kB
Tags Source
SHA-256 checksum
How to use checksums
83ca4a49e875af7c24e5ff87faa77ae842ce3e56bdf4468b28025dd6b49f9601
BLAKE2b-256 checksum
How to use checksums
ad1b0c930cfceba69e717561665bdf51647811d91e2d8a1656460bd5686bc8ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.13

Release files / hatch_simple_cython-0.1.0b3-py3-none-any.whl

Download URL hatch_simple_cython-0.1.0b3-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
52d198e6253232adc6192ce3be82c4facbd37f585e3bf513ddad73f1926870bd
BLAKE2b-256 checksum
How to use checksums
a16781f37d696570f3b63e7ee89b71519ab8e7b968d20c3249c148da01429817
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.13

Security for hatch-simple-cython 0.1.0b3

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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