Commit Graph
30 Commits
Author SHA1 Message Date
Paolo Bonzini 4b8886ee1b python: switch default rust_abi for extension modules to C
A Rust-ABI Python extension module makes no sense; add `rust_abi: c`
automatically.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-02-22 21:27:19 +05:30
Paolo Bonzini 30bab71b1d rename ExternalProgram object to Program
This matches the Python class name, which shows up in errors, and is simpler.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-01-08 08:40:07 -08:00
Dylan Baker f3d9a71a1b modules/python: use typed_kwargs for install_dir
This `install_dir` is slightly different than the one in `BuildTarget`
(though I'd like to make them the same in the future). It is only
allowed to be `str | bool | None`, and the implementation has always
assumed this, it would have broken with an array value.
2025-12-17 10:27:54 -08:00
Nirbheek Chauhan d16d5397e5 docs: Mention deprecation of path(), document full_path() 2025-03-03 18:08:58 +05:30
Ralf Gommers 731dcdf92f docs: fix description of py.install_sources arguments
There is actually very little overlap between `install_sources` and
`install_data` in arguments they accept: only 2/7 keywords for `install_data`
apply to `install_sources`.

Closes gh-12601
2024-11-17 19:32:31 -05:00
Luke Smith a608e56beb Correct typo in example Python module option
python.install_env is the correct command, as documented
in https://mesonbuild.com/Builtin-options.html#python-module.

python.install_venv causes an error, it is not immediately obvious
that the slight typo is the cause.
2024-10-31 17:39:16 -04:00
Nathan Goldbaum 4172cbd0fb docs: mention cython_args in cython reference docs 2024-07-12 13:52:55 -04:00
Emil Melnikov 141100e482 Add note about meson-python and installation path
New people that want to use Meson for building Python extensions most
probably will read Python module docs first. Direct them to meson-python
and suggest to set `python.install_env=auto`.
2024-06-10 18:12:56 -04:00
Andrew McNulty c730807696 Python: Add 'limited_api' kwarg to extension_module
This commit adds a new keyword arg to extension_module() that enables
a user to target the Python Limited API, declaring the version of the
limited API that they wish to target.

Two new unittests have been added to test this functionality.
2023-08-14 20:02:09 -04:00
Charles Brunet 51b9f2f1a5 Find python3.xx on windows 2023-05-02 17:52:10 -04:00
Eli Schwartz 9751c1fe61 add missing documentation for python installation default pure kwarg 2022-11-26 19:56:00 -05:00
Elliott Sales de Andrade 8c5838bfea Add missing since annotations in docs
This is based on searching for `@FeatureNew*` decorators.

There is also one correction to a version in a decorators;
`build_by_default` was added in #1303, which is 0.38.0, not 0.40.0.
2022-10-24 21:47:46 -04:00
Eli Schwartz 22dcb692ad python module: implicitly add python dep to extensions
If there isn't a preexisting dependency on python, append one. It's
almost assuredly needed, so just do the right thing out of the box.
2022-06-19 21:44:17 +03:00
Eli Schwartz aa874ea0d0 python module: default extensions to hidden symbol visibility
python compiled extensions should never need to expose any symbol other
than PyInit_* which is declared with default visibility via
PyMODINIT_FUNC on supported compilers.

Thus, a reasonably sane default is to mark any other symbols as hidden,
while still respecting any manually specified visibility.

Gate this on the version of python itself, as not all versions decorate
PyMODINIT_FUNC properly.
2022-05-09 10:49:04 -04:00
Xavier Claessens 329d111709 python: Add platlibdir and purelibdir options 2021-10-08 17:47:35 -04:00
Daniel Mensinger 2327cb5eb3 docs: Fix broken links 2021-10-03 12:19:45 +02:00
Xavier Claessens 276063a1d2 Add missing "disabler" kwarg to python.dependency()
There is a unit test using it and now fails because the warning about
unknown kwarg became fatal.
2021-08-30 14:00:54 -04:00
Xavier Claessens 8c5aa031b5 Add install tags
Fixes: #7007.
2021-08-17 15:19:18 -04:00
Jussi Pakkanen 474f4813c4 Capitalize "Meson" consistently as it is a proper name. [skip ci] 2021-01-31 19:49:20 +00:00
Jussi Pakkanen f72ee8e742 Rewrap long text lines in docs. [skip ci] 2021-01-30 16:19:59 +00:00
Nirbheek Chauhan 40b58be100 modules/python: Do not error out if positional args are passed
Also update the documentation.

Fixes https://github.com/mesonbuild/meson/issues/6470
2020-02-17 00:38:57 +02:00
Daniel Mensinger c4649704c8 python: add embed to the python dependency function 2019-12-18 01:19:16 +02:00
Dylan Baker 15ab1f64f9 modules/python: add a modules keyword argument
This mirrors the modules keyword argument that some dependencies (such
as qt and llvm) take. This allows an easier method to determine if
modules are installed.
2019-06-12 14:13:20 +03:00
Dylan Baker bd6bae0c71 docs: document that the .path() method for Python is new in 0.50 [skip ci]
Since this method was not included in 0.46-00.49 we should document that.
2019-03-09 19:01:57 +02:00
Alex Băluț 8f24d34e31 Fix links to reference manual 2019-01-09 09:11:58 -08:00
Luca Weiss 42cdb32033 Update Python-module.md
Fix link to the disabler object
2018-11-04 13:56:28 -05:00
Xavier Claessens 61348da069 Add 'disabler' argument to functions returning not-found objects
When dependency(), find_library(), find_program(), or
python.find_installation() return a not-found object and disabler is
true, they return a Disabler object instead.
2018-10-23 22:09:55 +03:00
Xavier Claessens 3cf03ec6d6 find_installation: Add support for feature option in required kwarg
Closes: #4165.
2018-09-16 15:07:43 +03:00
Mathieu Duponchelle 709e2bd70d Python module: update documentation for new API 2018-04-22 01:06:36 +02:00
Mathieu Duponchelle 56fc22075c [fixup]: write documentation 2018-04-09 15:46:06 +02:00