* gnu/packages/django.scm (python-django-statici18n)
[phases]{check}: Do not read PYTHONPATH from environment. Do not set
build/lib explicitly (the install site path is already in the Guix
PYTHONPATH).
* gnu/packages/machine-learning.scm (ghmm): Remove trailing #t.
[phases]: Do not reorder the check phase after the install phase.
{fix-PYTHONPATH}: Remove phase.
* gnu/packages/check.scm (python-pyhamcrest): Update to 2.0.2.
[propagated-inputs]: Remove python-six.
[phases]{check}: Do not set PYTHONPATH.
(python2-pyhamcrest): Remove variable.
* gnu/packages/virtualization.scm (ganeti): Remove trailing #t.
[phases]{build-bash-completions}: Do not set PYTHONPATH.
{pre-check}: Do patch PYTHONPATH from script.
{wrap}: Use the new GUIX_PYTHONPATH environment variable.
* gnu/packages/web.scm (linkchecker): Remove trailing #t.
[phases]: Do not reorder the check phase after the install phase.
{check}: Do not set PYTHONPATH.
* gnu/packages/bioinformatics.scm (bamm): Delete trailing #t.
[phases]{check}: Override rather than delete phase. Remove trailing #t.
{post-install-check}: Delete phase.
{wrap-executable}: Also wrap with the new GUIX_PYTHONPATH.
* gnu/packages/bioinformatics.scm (python-pysam)[arguments]: Remove the
'#:modules' argument.
[phases]: Remove trailing #t.
{check}: Do not manually set PYTHONPATH.
* gnu/packages/bioinformatics.scm (python-pybedtools): Remove trailing #t.
[phases]{check}: Do not manually set PYTHONPATH.
[arguments]: Remove the '#:modules' argument.
Add a new phase validating the usability of installed Python packages.
* gnu/packages/aux-files/python/sanity-check.py: New file.
* Makefile.am (AUX_FILES): Register it.
* guix/build-system/python.scm (sanity-check.py): New variable.
(lower): Add the script as an implicit input.
* guix/build/python-build-system.scm: Remove trailing #t.
(sanity-check): New phase.
(%standard-phases): Use it.
* tests/builders.scm: (make-python-dummy)
(dummy-ok, dummy-dummy-nosetuptools, dummy-fail-requirements)
(dummy-fail-import, dummy-fail-console-script): New variables.
("python-build-system: dummy-ok")
("python-build-system: dummy-dummy-nosetuptools")
("python-build-system: dummy-fail-requirements")
("python-build-system: dummy-fail-import")
("python-build-system: dummy-fail-console-script"): Add tests.
This also to reduce the need for boilerplate code found in check phase
overrides.
* guix/build/python-build-system.scm (add-install-to-path): New phase.
(%standard-phases): Order it before the check phase.
This is to remove the need for common boilerplate code in check phase
overrides.
* guix/build/python-build-system.scm
(add-installed-pythonpath): Streamline. This phase depends on the presence of
a "python" input; thus GUIX_PYTHONPATH is guaranteed to be defined. Update doc.
(add-install-to-pythonpath): New phase.
(%standard-phases): Order it before the check phase.
Using PYTHONPATH as a mean to discover the Python packages had the following
issues:
1. It is not versioned, so different versions of Python would clash if
installed in a shared profile.
2. It would interfere with the host Python site on foreign
distributions, sometimes preventing a a user to login their GDM
session (!).
3. It would take precedence over user installed Python packages
installed through pip.
4. It would leak into Python virtualenvs, which are supposed to create
isolated Python environments.
This changes fixes the above issues by making use of a sitecustomize.py
module. The newly introduced GUIX_PYTHONPATH environment variable is read
from the environment, filtered for the current Python version of the
interpreter, and spliced in 'sys.path' just before Python's own site location,
which provides the expected behavior.
* gnu/packages/aux-files/python/sitecustomize.py: New file.
* Makefile.am: Register it.
* gnu/packages/python.scm (customize-site)
(guix-pythonpath-search-path): New procedures.
(python-2.7)[phases]{install-sitecustomize.py}: New phase.
[native-inputs]{sitecustomize.py}: New input.
[native-search-paths]: Replace PYTHONPATH with GUIX_PYTHONPATH.
(python-3.9)[native-search-paths]: Likewise.
[phases]{install-sitecustomize}: Override with correct version.
[native-search-paths]: Replace PYTHONPATH with GUIX_PYTHONPATH.
* gnu/packages/commencement.scm (python-boot0):
[phases]{install-sitecustomize}: Likewise.
[native-inputs]{sitecustomize.py}: New input.
[native-search-paths]: Replace PYTHONPATH with GUIX_PYTHONPATH.
* guix/build/python-build-system.scm (site-packages): Do not add a trailing
'/'.
squash! gnu: python: Replace PYTHONPATH by GUIX_PYTHONPATH.
* gnu/packages/xdisorg.scm (pixman) [arguments] Pass --enable-timers and
--enable-gnuplot to #:configure-flags.
Signed-off-by: Leo Famulari <leo@famulari.name>
* gnu/packages/image.scm (openjpeg)[arguments]: Enable the test suite.
Pass -DBUILD_UNIT_TESTS, -DBUILD_TESTING, and -DOPJ_DATA_ROOT
to #:configure-flags. Add a new 'disable-failing-tests' phase.
[native-inputs]: Add openjpeg-data.
Signed-off-by: Leo Famulari <leo@famulari.name>