Skip to content

Commit 290af7d

Browse files
committed
doc: extend --enable-set-pythonpath documentation
Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
1 parent ee8de6c commit 290af7d

4 files changed

Lines changed: 30 additions & 3 deletions

File tree

.hunspell.en.dic

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,3 +1339,5 @@ OSX
13391339
BAWT
13401340
HTTPS
13411341
mirrorEnvVarChange
1342+
PYTHONPATH
1343+
pythonpath

NEWS.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,21 @@ Modules 5.7.0 (not yet released)
111111
* Also consider ``-`` in addition to ``.`` as a version number separator
112112
character when selecting a module with the :mconfig:`extended_default`
113113
mechanism. (fix issue #619)
114+
* Rename Modules initialization script for Python ``env_modules.py`` to make
115+
it a proper Python module name.
116+
* Rename the Python initialization script to :file:`env_modules.py` so that it
117+
uses a valid Python module name. Generates a :file:`python.py` symlink onto
118+
:file:`env_modules.py` to preserve compatibility. (contribution from Byron
119+
Boulton)
120+
* Install: introduce the :instopt:`--enable-set-pythonpath` installation
121+
option to prepend Modules ``init`` directory to the :envvar:`PYTHONPATH`
122+
environment variable during Modules initialization. This option is enabled
123+
by default and make it easier to import the ``env_modules`` Python module.
124+
(fix issue #483 with contribution from Byron Boulton)
125+
* Install: add the :instopt:`--enable-append-pythonpath` installation option,
126+
which causes :instopt:`--enable-set-pythonpath` to append the Modules
127+
``init`` directory to :envvar:`PYTHONPATH` instead of prepending it.
128+
(contribution from Byron Boulton)
114129

115130

116131
.. _5.6 release notes:

doc/source/changes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,10 @@ The following module sub-commands appeared on Modules 5.
10101010
Starting Modules 5.5, definition of :command:`mogui` shell alias or function
10111011
is added on this sub-command.
10121012

1013+
Starting Modules 5.7, initialization directory is added to ``PYTHONPATH``
1014+
environment variable unless installation option
1015+
:instopt:`--disable-set-pythonpath<--enable-set-pythonpath>` is used.
1016+
10131017
:subcmd:`lint`
10141018

10151019
Starting Modules 5.6, readable modulecache files are also linted when no

doc/source/module.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,18 @@ time if :command:`mogui-cmd` command is found in :envvar:`PATH`.
8989
changes performed in the GUI is applied onto the shell session that executed
9090
:command:`mogui`.
9191

92+
The installation location of the ``env_modules`` Python module may also be
93+
added to the :envvar:`PYTHONPATH` environment variable during initialization,
94+
unless the :instopt:`--enable-append-pythonpath` installation option has been
95+
disabled.
96+
9297
.. only:: html or latex
9398

9499
.. versionchanged:: 5.5
95100
Definition of :command:`mogui` alias or function added
96101

102+
.. versionchanged:: 5.7
103+
Update of :envvar:`PYTHONPATH` environment variable added
97104

98105
Examples of initialization
99106
^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -128,14 +135,13 @@ Perl:
128135
129136
Python:
130137

131-
Default installation should have added |file initdir| to the :envvar:`PYTHONPATH` environment variable allowing initialization as follows
132-
133138
.. parsed-literal::
134139
135140
from env_modules import module
136141
module("load", "modulefile", "modulefile", "...")
137142
138-
Otherwise
143+
Alternative initialization for Python if ``env_modules`` script is not part of
144+
an enabled Python module directory:
139145

140146
.. parsed-literal::
141147

0 commit comments

Comments
 (0)