hatch-cython
Cython build hooks for hatch
Decision gist · record as of 2026-08-14
Yes, if you are building Cython extensions with Hatch. The plugin is actively maintained, has low install friction, and eliminates boilerplate setup.py code. It is not needed if you are not using Cython or are using a different build backend. Be aware that build-time dependencies (Cython, setuptools, and any library includes) must be explicitly listed in build-system.requires.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Cython and setuptools must be in build-system.requires at load time, not just as hook dependencies; additional packages (numpy, pyarrow, etc.) required in build-system.requires if their include paths are used.
- Low install friction; pure Python wheel with four runtime dependencies (cython, hatchling, setuptools, typing-extensions).
- Actively maintained with recent commits and passing CI/CD.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions; suitable for most projects.
last release 2025-12-18 (239 days) · last repo commit 2026-03-05 · 37 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 198,359 downloads/mo, #9,734 on PyPI
Alternatives
Verify before relying
# Add to pyproject.toml [build-system]
requires = ["hatchling", "hatch-cython", "Cython", "setuptools"]
build-backend = "hatchling.build"
# Configure in [tool.hatch.build.targets.wheel.hooks.cython.options]
[tool.hatch.build.targets.wheel.hooks.cython.options]
directives = { language_level = 3 }- Whether the hook automatically discovers .pyx/.pxd files or requires explicit file configuration.
- Performance overhead or build-time impact compared to setuptools-only Cython builds.
- Compatibility with editable installs and development workflows.
What it is and what it does
hatch-cython is a Hatch build backend plugin that automates Cython compilation during wheel builds. It acts as a bridge between Hatch's modern build system and Cython's C extension compilation, handling the configuration and invocation of the Cython compiler as part of the standard Python package build process.
The plugin supports integration with scientific libraries (NumPy, PyArrow, Pythran) by resolving their include paths and libraries at build time. It exposes Cython compiler directives, custom compilation arguments, and macro definitions through pyproject.toml or hatch.toml configuration, eliminating the need for custom setup.py scripts. The package requires Cython, hatchling, setuptools, and typing-extensions as runtime dependencies.
Use it for
- Building Python packages with Cython-compiled modules using Hatch as the build backend.
- Integrating NumPy or PyArrow headers and libraries into Cython extensions without manual path configuration.
- Configuring Cython compiler directives (boundscheck, nonecheck, language_level) declaratively in pyproject.toml.
- Compiling performance-critical code sections to C while maintaining a pure-Python package structure.
- Creating wheels with C extensions for multiple Python versions (3.8–3.13) via a single build configuration.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are building Cython extensions with Hatch.
The plugin is actively maintained, has low install friction, and eliminates boilerplate setup.py code. It is not needed if you are not using Cython or are using a different build backend. Be aware that build-time dependencies (Cython, setuptools, and any library includes) must be explicitly listed in build-system.requires.
Install
hatch-cython on PyPI
Before you install
Low install friction; pure Python wheel with four runtime dependencies (cython, hatchling, setuptools, typing-extensions). Actively maintained with recent commits and passing CI/CD.
Cython and setuptools must be in build-system.requires at load time, not just as hook dependencies; additional packages (numpy, pyarrow, etc.) required in build-system.requires if their include paths are used.
License in practice
MIT license permits commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
# Add to pyproject.toml [build-system]
requires = ["hatchling", "hatch-cython", "Cython", "setuptools"]
build-backend = "hatchling.build"
# Configure in [tool.hatch.build.targets.wheel.hooks.cython.options]
[tool.hatch.build.targets.wheel.hooks.cython.options]
directives = { language_level = 3 }
Verify before relying
- Whether the hook automatically discovers .pyx/.pxd files or requires explicit file configuration.
- Performance overhead or build-time impact compared to setuptools-only Cython builds.
- Compatibility with editable installs and development workflows.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packagescythonhatchlingsetuptoolstyping-extensions |
| Maintenance | Actively maintained 239 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 198,359 / month, #9,734 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Build ToolsTopic :: Software Development :: Code GeneratorsTopic :: Software Development :: Compilers |
Evidence: hatch_cython-0.6.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “cython build hook hatch”
- hatch-cythonA Hatch build hook that integrates Cython compilation into the wheel…
- hatch-jupyter-builderA Hatch build hook plugin that automates the build process for…
- hatch-vcsA Hatch plugin that automatically determines your project's version…
Give your agent the search over MCP, or paste the wish link into any chat.
More Build Tools packages
Provides reusable utilities for Python packaging interoperability, including version handling, specifiers, markers, requirements, tags, and metadata parsing according to standards like PEP 440 and PEP 425.
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
pip is the standard installer for Python packages, enabling you to download and install packages from the Python Package Index and other indexes into your Python environment.
Hatchling is a standards-compliant Python build backend that handles packaging, metadata, and distribution of Python projects when configured in a project's pyproject.toml file.
Generates Python gRPC service stubs and message classes from Protocol Buffer definitions, enabling developers to build gRPC clients and servers.
pre-commit is a framework for installing and running git hooks written in any language before commits are made, automating code quality and validation checks across multi-language projects.
Install it if your team needs consistent, automated validation at commit time.
See also Cython · hatch-polylith-bricks · hatch · hatchling-autoextras-hook · hatch_build_scripts · hatch-vcs · hatch-regex-commit · extension-helpers · scikit-build-core