Skip to main content

mesonpy PyPI version

pre-commit.ci status checks tests codecov

Python build backend (PEP 517) for Meson projects.

Usage

Enabling the build backend

To use this build backend, you must specify it in your pyproject.toml file.

[build-system]
build-backend = 'mesonpy'
requires = [
  'meson-python',
]

If you have any other build dependencies, you must also add them to the requires list.

Specifying the project metadata

mesonpy supports specifying Python package metadata in the project table in pyproject.toml (PEP 621).

To do so, you just need to add a project section with the details you want to specify (see PEP 621 for the specification of the format).

...

[project]
name = 'orion'
version = '1.2.3'
description = 'The Orion constellation!'
readme = 'README.md'
license = { file = 'LICENSE' }
keyword = ['constellation', 'stars', 'sky']
authors = [
  { name = 'Filipe Laíns', email = 'lains@riseup.net' },
]
classifiers = [
  'Development Status :: 4 - Beta',
  'Programming Language :: Python',
]

requires-python = '>=3.7'
dependencies = [
  'stars >= 1.0.0',
  'location < 3',
]

[project.optional-dependencies]
test = [
  'pytest >= 3',
  'telescope',
]

[project.urls]
homepage = 'https://constellations.example.com/orion'
repository = 'https://constellations.example.com/orion/repo'
documentation = 'https://constellations.example.com/orion/docs'
changelog = 'https://constellations.example.com/orion/docs/changelog.html'

In case you want mesonpy to detect the version automatically from Meson, you can omit the version field and add it to project.dynamic.

[project]
name = 'orion'
dynamic = [
  'version',
]
...

Automatic metadata

If no other metadata is specified, mesonpy will fetch the project name and version from Meson. In which case, you don't need to add anything else to your pyproject.toml file.

This is not recommended. Please consider specifying the Python package metadata.

Status

  • Pure Python modules :+1:
  • Native modules
    • Don't link aginst anything :+1:
    • Link aginst external libraries :+1:
    • Link aginst libraries from the Meson project :+1:
    • Detect the ABI :+1:
  • Scripts (executables in Meson)
    • Don't link aginst anything :+1:
    • Link against external libraries :+1:
    • Link against libraries from the Meson project :hammer:

Platform Support

  • Linux :+1:
  • Windows :soon:
  • MacOS :soon:
  • Other UNIX-like :warning:
    • Most platforms should work, but currently that is not tested or guaranteed

Limitations

No data

Data (install_data) is not supported by the wheel standard. Project should install data as Python source instead (Python source does not have to be only Python files!) and use importlib.resources (or the importlib_resources backport) to access the data. If you really need the data to be installed where it was previously (eg. /usr/data), you can do so at runtime.

Release files for meson-python 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for meson-python 0.2.0
File Size Uploaded
meson_python-0.2.0.tar.gz 26.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for meson-python 0.2.0
File Interpreter ABI Platform
meson_python-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 41.7 kB

Release files / meson_python-0.2.0.tar.gz

Download URL meson_python-0.2.0.tar.gz
Size 26.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d2d6d5ddc82cd7297824c5f6cf29a48f95f8c64c7870f6705ebce83c3a94acee
BLAKE2b-256 checksum
How to use checksums
d883230c7de8dbb606f2a0c9c7fafd2b3764649fc30b138722eb16de98850bd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

Release files / meson_python-0.2.0-py3-none-any.whl

Download URL meson_python-0.2.0-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
722f32983b835669e5e5aeb4c4219aab666caa97d98ca5678414ac6afc742e0e
BLAKE2b-256 checksum
How to use checksums
482df9fdfe52e09b1492afdf4f700da274018755ac6e20f265b3fdc8894954e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

Release history Release notifications | RSS feed

0.21.1

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.17.1

2 release files

0.17.0

2 release files

0.16.0

2 release files

0.15.0

2 release files

0.13.2

2 release files

0.13.1

2 release files

0.13.0

2 release files

0.12.1

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

This release

0.2.0 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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