Mebuex
A setuptools Extension and build_ext wrapper for builds based on Meson.
Usage
Mebuex assumes that the structure of a package is as follows:
root
| - builddir
| ... some source layout to be compiled with Meson ...
| - *packagename*
| | ... Python package layout handled by setup.py ...
| - setup.py
| - meson.build
That is, the root directory of the package contains the setup.py file,
the meson.build file, a Meson build directory (here builddir, but can be
configured), directories covering the sources to be built by Meson, and the
Python package source tree.
The relevant part of this layout is that setup.py and meson.build are
contained in the root directory, and that a designated build directory is
specified (need not exist before building). The Meson build file should contain
all relevant configuration to build a Python extension within the build
directory (here builddir). The setup.py file should be based on setuptools
and contain all relevant configuration for the Python part of the package.
Within the setup.py file, the Python extension built by Meson can then be
included using the MesonExtension and build_ext commands supplied by Mebuex.
An example code would look like this (suppose that the Meson build would yield
an extension mypackage.backend):
from setuptools import setup
from mebuex import MesonExtension, build_ext
ext = MesonExtension('mypackage.backend', builddir='builddir')
setup(name='mypackage',
version='1.0.0',
author='Me',
description='Or is it yours?',
ext_modules=[ext],
cmdclass={'build_ext' : build_ext}
)
Finding the NumPy include directory
Mebuex ships with a Python script to discover the system NumPy includes when
building in the isolated build environment. The gravelspoon command that
helps break out of the build prison can be used in a meson.build file as
follows:
incpath_np = run_command(
gravelspoon
)
incdir_np = include_directories([incpath_np])
Install
Mebuex can be installed with Pip locally
pip install .
or from PyPI:
pip install mebuex
License
Mebuex is licensed under the MIT license (see the LICENSE file).
Changelog
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[1.3.0] - 2024-04-07
Added
- Add the
mebuex_destpathandmebuex_destnameattributes to theMebuexExtensionclass. This can be used from install scripts, after performing thebuild_extcommand, to retrieve the destination path where the extension file was copied to.
[1.2.0] - 2023-12-29
Added
- Add the
gravelspooncommand to break out of the setuptools build isolation and find the system NumPy includes.
[1.1.7] - 2023-08-20
Added
- Print error message stderr when re-raising assumed compilation error.
[1.1.6] - 2023-08-20
Added
- Print error message when re-raising assumed compilation error.
[1.1.5] - 2023-06-02
Changed
- Try wiping the build directory if compilation within a previously setup build directory fails.
[1.1.4] - 2023-05-04
Changed
- Be more verbose on
destpatherror inbuild_ext.build_extension.
[1.1.3] - 2023-04-14
Added
- Add example project in
example/subfolder.
[1.1.2] - 2023-04-13
Changed
- Change to
pyproject.tomlinstall workflow.
[1.1.1] - 2022-10-05
Changed
- Add a more informative error message if the directory to copy the built extension to does not exist.
[1.1.0] - 2022-07-13
Changed
- Fixed empty lib being copied to wheel directory instead of Meson-compiled lib.
- Fix handling of dots in compiled names (likely irrelevant).
[1.0.0] - 2022-07-13
Added
- First version
Metadata
Release files for mebuex 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mebuex-1.3.0.tar.gz | 6.6 kB | Without provenance | Details for mebuex-1.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mebuex-1.3.0-py3-none-any.whl | Python 3 | none | any | Details for mebuex-1.3.0-py3-none-any.whl |
Total release size: 14.8 kB
Release files / mebuex-1.3.0.tar.gz
| Download URL | mebuex-1.3.0.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
944081f58bb3c1516572f4f2f51b7377ee24ffe4a9d31f121f5b0165030a0111
|
|
BLAKE2b-256 checksum How to use checksums |
e7fd5e956fa38bdcfc163e080e49043984fa218b7844519178d7e526febd6b45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.8
|
Release files / mebuex-1.3.0-py3-none-any.whl
| Download URL | mebuex-1.3.0-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47b160c34b17d094776f058c6464031b79e055f4ef3b503ad633e8b155c7fd41
|
|
BLAKE2b-256 checksum How to use checksums |
13de2bd42cccfa06d3ddd8ec66fa470ec384912998c97f0ec06ff0d962159ea9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.8
|
Security for mebuex 1.3.0
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.