aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-06-19 00:51:54 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2022-06-19 21:44:17 +0300
commit22dcb692adefea7d51e480e36a53446cc0777c01 (patch)
tree5282233fbdc4c870027469cdcee28dd6feac26c8 /docs/markdown
parent43c60318fd28d23772cbc7a2b2e3152f6ec59e68 (diff)
downloadmeson-22dcb692adefea7d51e480e36a53446cc0777c01.zip
meson-22dcb692adefea7d51e480e36a53446cc0777c01.tar.gz
meson-22dcb692adefea7d51e480e36a53446cc0777c01.tar.bz2
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.
Diffstat (limited to 'docs/markdown')
-rw-r--r--docs/markdown/Python-module.md6
-rw-r--r--docs/markdown/snippets/python-extension-module-implicit-dependency.md13
2 files changed, 16 insertions, 3 deletions
diff --git a/docs/markdown/Python-module.md b/docs/markdown/Python-module.md
index 8809fd0..bf40ce4 100644
--- a/docs/markdown/Python-module.md
+++ b/docs/markdown/Python-module.md
@@ -99,9 +99,9 @@ Additionally, the following diverge from [[shared_module]]'s default behavior:
of Python that support this (the python headers define `PyMODINIT_FUNC` has
default visibility).
-`extension_module` does not add any dependencies to the library so
-user may need to add `dependencies : py_installation.dependency()`,
-see [[dependency]].
+*since 0.63.0* `extension_module` automatically adds a dependency to the library
+if one is not explicitly provided. To support older versions, the user may need to
+add `dependencies : py_installation.dependency()`, see [[dependency]].
**Returns**: a [[@build_tgt]] object
diff --git a/docs/markdown/snippets/python-extension-module-implicit-dependency.md b/docs/markdown/snippets/python-extension-module-implicit-dependency.md
new file mode 100644
index 0000000..1b98df8
--- /dev/null
+++ b/docs/markdown/snippets/python-extension-module-implicit-dependency.md
@@ -0,0 +1,13 @@
+## Python extension modules now depend on the python library by default
+
+Python extension modules are usually expected to link to the python library
+and/or its headers in order to build correctly (via the default `embed: false`,
+which may not actually link to the library itself). This means that every
+single use of `.extension_module()` needed to include the `dependencies:
+py_installation.dependency()` kwarg explicitly.
+
+In the interest of doing the right thing out of the box, this is now the
+default for extension modules that don't already include a dependency on
+python. This is not expected to break anything, because it should always be
+needed. Nevertheless, `py_installation.dependency().partial_dependency()` will
+be detected as already included while providing no compile/link args.