Skip to main content

Meson Python build backend (PEP 517)

Project description

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 against 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.

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

meson_python-0.2.1.tar.gz (26.9 kB view details)

Uploaded Source

Built Distribution

meson_python-0.2.1-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file meson_python-0.2.1.tar.gz.

File metadata

  • Download URL: meson_python-0.2.1.tar.gz
  • Upload date:
  • Size: 26.9 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for meson_python-0.2.1.tar.gz
Algorithm Hash digest
SHA256 3094f3b90ef3ca54c08c1068977d9aa4cb2dff7a546e85f52178833a135020fb
MD5 6d0d1e784fc9e5e01fd556e2d0c8d3ec
BLAKE2b-256 9c65b85b46e7fd68079c7716403070eb55957ff1d471fad77024b6c492bc24e8

See more details on using hashes here.

File details

Details for the file meson_python-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: meson_python-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for meson_python-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9b5ff5d7c577e4bae36c401b27f8c77fbc2f3f529901cfae9729b5cd6faa10ab
MD5 f09a9ca0220a542597d7cc0249c9abc8
BLAKE2b-256 cd74abbee31dbfe4b21963e9465e2cd4c7437bd151ac766340a485b066b84652

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page