skillfed

meson-python

Meson Python build backend (PEP 517)

meson-python v0.20.0 15.3M downloads/30d#1,190 on PyPI180
Permissive license MIT Active released

What it is and what it does

meson-python is a build backend for Python packages that integrates the Meson build system into the PEP 517 build process. It is designed primarily for package developers who need to compile native extensions in languages like C, C++, Cython, Fortran, Pythran, or Rust. Instead of writing configuration in traditional setup files, you define your configuration in Meson's meson.build files, which meson-python then orchestrates during installation.

The package depends on meson, packaging, pyproject-metadata, and tomli. It is actively maintained, has been in production use since 2021-10-28, and carries no known security vulnerabilities. It is best suited for projects where Meson's build speed and user-friendly configuration are advantages for complex C/C++ or polyglot extension modules.

Use it for:

  • Building Python packages with C or C++ extensions using Meson's faster system and cleaner configuration syntax.
  • Compiling Cython, Fortran, or Rust extensions as part of a Python package distribution.
  • Migrating to Meson for projects where compilation complexity or performance is a concern.
  • Packaging scientific libraries that combine Python with compiled numerical code.
  • Standardizing configuration across polyglot projects that already use Meson for non-Python components.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

meson-python is a PEP 517 build backend that uses the Meson build system to configure and compile Python packages, particularly those with native extension modules in C, C++, Cython, Fortran, Pythran, or Rust.

Yes, if you are a package developer building Python extensions and want to use Meson. The package is production-stable, actively maintained, has no known vulnerabilities, and low install friction. Not relevant for end users installing pre-built wheels; only needed during development and packaging.

Install

meson-python on PyPI

pip

pip install meson-python

uv

uv add meson-python

poetry

poetry add meson-python

Installing meson-python

Before you install

Low install friction with a pure-wheel distribution. The package is actively maintained with a recent release and no known vulnerabilities. Runtime dependencies are minimal and stable: meson, packaging, pyproject-metadata, tomli.

License in practice

MIT license is permissive and imposes no restrictions on use, modification, or redistribution. Safe for both open-source and commercial projects.

Quickstart

# In pyproject.toml:
[build-system]
requires = ["meson-python", "meson", "ninja"]
build-backend = "mesonpython.build"

# Then build with:
pip install --no-build-isolation .

Requires Meson and Ninja to be installed on the system; intended for package developers, not end users installing pre-built wheels.

Verify before relying

  • Whether Meson and Ninja installation is automatic or requires manual setup on all target platforms.
  • Performance characteristics compared to alternative build backends for typical extension modules.
  • Maturity of support for less common languages like Pythran and Fortran in practice.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 4 — meson, packaging, pyproject-metadata, tomli
Maintenance actively maintained — 65 days since the last release
Last repo commit
First released
Downloads 15,272,549/month — #1,190 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: meson_python-0.20.0-py3-none-any.whl

Keywords: meson, build, backend, pep517, package

Development Status :: 5 - Production/StableProgramming Language :: PythonTopic :: Software Development :: Build Tools

Tags

python build backend mesonnative extension build systempep 517 build backendc++ python package buildmeson python compilation
build-backendnative-extensionspep517

More Build Tools packages