Add --with-pythondir installation option - #687
Merged
Merged
Conversation
Add the --with-pythondir option to the configure installation script to define a particular installation directory for the env_modules Python module. It enables for instance to install env_modules.py with the other Python modules available on the system. If option is not defined, env_modules.py is installed by default in initdir. Whatever the installation directory of the Python module, the python.py symbolic link created in initdir points to its location. When option is set, the PYTHONPATH environment variable defined during initialization (if --enable-set-pythonpath is used) refers to this directory rather initdir. Fixes envmodules#643 Assisted-by: Claude:claude-fable-5 Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
Expected PYTHONPATH value now depends on the directory where the env_modules Python module is installed. Also check this Python module and the python.py symbolic link are found at their expected location once installed. Assisted-by: Claude:claude-fable-5 Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
Also fix the installation option named in module.1 to describe the condition disabling PYTHONPATH setup during initialization (--enable-set-pythonpath, not --enable-append-pythonpath). Assisted-by: Claude:claude-fable-5 Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
Assisted-by: Claude:claude-fable-5 Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
Use the --with-pythondir installation option to install the env_modules Python module with the other Python modules available on the system (in python3_sitelib directory). As this location is searched by default by the Python installation, PYTHONPATH setup during module command initialization is disabled. python3-devel build requirement provides the python3_sitelib macro and the Python interpreter used to byte-compile the env_modules module. This setup is applied where /usr/bin/python3 is used as Python interpreter (Fedora 22+ and EL8+). Older platforms keep installing env_modules.py in initdir. Assisted-by: Claude:claude-fable-5 Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the
--with-pythondirconfigure option to define the installation directory of theenv_modulesPython module. It enables for instance to installenv_modules.pywith the other Python modules available on the system (e.g., in Python'ssite-packagesdirectory).When the option is not set,
env_modules.pyis installed in the initialization script directory as before. Whatever the installation directory, thepython.pysymbolic link created in the initialization script directory points to the module location. When the option is set, the directory added toPYTHONPATHduring initialization (if--enable-set-pythonpathis used) refers to this location rather than the initialization directory. If the module is installed in a directory already searched by the Python installation,--disable-set-pythonpathmay be used, as documented in INSTALL.The RPM spec file now installs
env_modules.pyin%python3_siteliband disablesPYTHONPATHsetup at initialization, on platforms where/usr/bin/python3is used (Fedora 22+ and EL8+). The el8 and el9 CI jobs exercise the new option.Fixes #643