Skip to content

Commit 109d9cb

Browse files
committed
DOC: add simple editable installs documentation
Signed-off-by: Filipe Laíns <[email protected]>
1 parent 920c4bd commit 109d9cb

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

docs/index.rst

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,57 @@ frontend, like ``builddir``, to specify the build directory to use/re-use. You
4949
can find more information about them in the `build options page`_.
5050

5151

52+
Editable installs
53+
-----------------
54+
55+
Editable installs allow you to install the project in such a way where you can
56+
edit the project source and have those changes be reflected in the installed
57+
module.
58+
59+
The way it works on ``meson-python`` specifically, is that when you import a
60+
module of the project, it will be rebuilt. This means that project imports will
61+
take more time than usual.
62+
63+
You can use pip, or other package manager, to install the project in editable
64+
mode.
65+
66+
67+
.. code-block::
68+
69+
python -m pip install -e .
70+
71+
72+
It might be helpful to see the output of the Meson_ commands. This is offered
73+
as a **provisional** feature, meaning it is subject to change.
74+
75+
If you want to temporarily enable the output, you can set the
76+
``MESONPY_EDITABLE_VERBOSE`` environment variable to a non-empty value. If this
77+
environment variable is present during import, the Meson_ commands and their
78+
output will be printed.
79+
80+
81+
.. code-block::
82+
83+
MESONPY_EDITABLE_VERBOSE=1 python my_script.py
84+
85+
86+
87+
This behavior can also be enabled by default by passing the ``editable-verbose``
88+
config setting when installing the project.
89+
90+
91+
.. code-block::
92+
93+
python -m pip install -e . --config-settings editable-verbose=
94+
95+
96+
This way, you won't need to always set ``MESONPY_EDITABLE_VERBOSE`` environment
97+
variable, the Meson_ commands and their output will always be printed.
98+
99+
The ``MESONPY_EDITABLE_VERBOSE`` won't have any effect during the project
100+
install step.
101+
102+
52103
How does it work?
53104
=================
54105

0 commit comments

Comments
 (0)