aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-03-10 19:03:03 -0500
committerJussi Pakkanen <jpakkane@gmail.com>2022-03-15 11:22:59 +0200
commit68b8fbcf6d684e93fe11e08f383945e6661e071b (patch)
treeba39d8d6c8c60a8eaab42ca4d0fee1ef8ea8593e /docs
parent7c20890a05481e97eee57a147f50237087a1c94e (diff)
downloadmeson-68b8fbcf6d684e93fe11e08f383945e6661e071b.zip
meson-68b8fbcf6d684e93fe11e08f383945e6661e071b.tar.gz
meson-68b8fbcf6d684e93fe11e08f383945e6661e071b.tar.bz2
Revert "devenv: Set PYTHONPATH where we install python modules"
This reverts commit 79c6075b560dbf1c3e4e0b30f1c472dc2086421e. # Conflicts: # docs/markdown/snippets/devenv.md # mesonbuild/modules/python.py # test cases/unit/91 devenv/test-devenv.py PYTHONPATH cannot be reliably determined. The standard use case for installing python modules with Meson is mixed pure sources (at least `__init__.py`) and compiled extension_modules or configured files. Unfortunately that doesn't actually work because python will not load the same package hierarchy from two different directories, one a source directory and one a (mandatory) out of tree build directory. (It kind of can, but you need to do what this test case accidentally stumbled upon, which is namespace packages. Namespace packages are a very specific use case and you are NOT SUPPOSED to use them outside that use case, so people are not going to use them just to circumvent Meson devenv stuff as that would have negative install-time effects.) Adding PYTHONPATH anyway will just lead to documentation commitments which we cannot actually uphold, and confusing issues at time of use because some imports *will* work... and some will *not*. The end result will be a half-created tree of modules which just doesn't work together at all, but because it partially works, users attempting to debug it will spend time wondering why parts of it do import. For any case where the automatic devenv would work correctly, it will also work correctly to use `meson.add_devenv()` a single time, which is very easy to manually get correct and doesn't provide any significant value to automate. In the long run, an uninstalled python package environment will require "editable installs" support.
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Commands.md9
-rw-r--r--docs/markdown/snippets/devenv.md6
2 files changed, 0 insertions, 15 deletions
diff --git a/docs/markdown/Commands.md b/docs/markdown/Commands.md
index f905d2c..b137166 100644
--- a/docs/markdown/Commands.md
+++ b/docs/markdown/Commands.md
@@ -340,15 +340,6 @@ These variables are set in environment in addition to those set using `meson.add
schemas is compiled. This is automatically set when using `gnome.compile_schemas()`.
Note that this requires GLib >= 2.64 when `gnome.compile_schemas()` is used in
more than one directory.
-- `PYTHONPATH` *Since 0.62.0* includes every directory where a python module is being
- installed using [`python.install_sources()`](Python-module.md#install_sources)
- and [`python.extension_module()`](Python-module.md#extension_module). Python
- modules installed by other means, such as `install_data()` or `install_subdir()`,
- will not be included and should be added to `PYTHONPATH` manually using
- [`meson.add_devenv()`](Reference-manual_builtin_meson.md#mesonadd_devenv).
- Note that when modules are installed into subdirectories the source tree
- layout must match the installed tree layout otherwise `import subdir.mod`
- cannot work.
Since *Since 0.62.0* if bash-completion scripts are being installed and the
shell is bash, they will be automatically sourced.
diff --git a/docs/markdown/snippets/devenv.md b/docs/markdown/snippets/devenv.md
index 104cfd9..bffa5fa 100644
--- a/docs/markdown/snippets/devenv.md
+++ b/docs/markdown/snippets/devenv.md
@@ -1,9 +1,3 @@
-## `PYTHONPATH` automatically defined in `meson devenv`
-
-`PYTHONPATH` now includes every directory where a python module is being
-installed using [`python.install_sources()`](Python-module.md#install_sources)
-and [`python.extension_module()`](Python-module.md#extension_module).
-
## Bash completion scripts sourced in `meson devenv`
If bash-completion scripts are being installed and the shell is bash, they will