diff tests/test-install.t @ 43412:ca0cd0a13514 stable

tests: look for ensurepip before using venv Debian appears to cripple the venv module by default by removing the associated ensurepip functionality. (The module isn't present at all.) This caused test-install.t to fail when using the Debian python3 unless the python3-venv package was installed. This commit introduces a new hghave requirement for detecting ensurepip and makes the Python 3 install variant conditional on its presence. This should make test-install.t pass when using an incomplete Debian Python. Differential Revision: https://phab.mercurial-scm.org/D7228
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 04 Nov 2019 23:42:18 -0800
parents 9bab6407c2c9
children 697c2e32c490
line wrap: on
line diff
--- a/tests/test-install.t	Thu Oct 17 16:46:13 2019 -0400
+++ b/tests/test-install.t	Mon Nov 04 23:42:18 2019 -0800
@@ -241,12 +241,15 @@
 shell environment in order to make the virtualenv work reliably.
 
 On Python 3, we use the venv module, which is part of the standard library.
+But some Linux distros strip out this module's functionality involving pip,
+so we have to look for the ensurepip module, which these distros strip out
+completely.
 On Python 2, we use the 3rd party virtualenv module, if available.
 
   $ cd $TESTTMP
   $ unset PYTHONPATH
 
-#if py3
+#if py3 ensurepip
   $ "$PYTHON" -m venv installenv >> pip.log
 
 Note: we use this weird path to run pip and hg to avoid platform differences,