[tor-commits] [stem/master] Include PYTHONPATH within install test

atagar at torproject.org atagar at torproject.org
Sat Apr 4 01:48:33 UTC 2020


commit 4fd47d39115f8dac432c6204244079cf755e1912
Author: Damian Johnson <atagar at torproject.org>
Date:   Fri Apr 3 18:46:11 2020 -0700

    Include PYTHONPATH within install test
    
    Damn I hate remote debugging. Our installation tests work for me, but fail
    under Jenkins with the following. Experimentally adding a PYTHONPATH to see if
    that does the trick.
    
      ======================================================================
      FAIL: test_install
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/srv/jenkins-workspace/workspace/stem-tor-ci/stem/util/test_tools.py", line 141, in <lambda>
          self.method = lambda test: self.result(test)  # method that can be mixed into TestCases
        File "/srv/jenkins-workspace/workspace/stem-tor-ci/stem/util/test_tools.py", line 208, in result
          test.fail(self._result.msg)
      AssertionError: Unable to install with 'python setup.py install': /usr/bin/python3 setup.py install --prefix /tmp/stem_test returned exit status 1
      ----------------------------------------
      stdout:
      ----------------------------------------
      running install
      Checking .pth file support in /tmp/stem_test/lib/python3.7/site-packages/
      /usr/bin/python3 -E -c pass
      ----------------------------------------
      stderr:
      ----------------------------------------
      /usr/lib/python3/dist-packages/setuptools/dist.py:475: UserWarning: Normalizing '1.8.0-dev' to '1.8.0.dev0'
        normalized_version,
      TEST FAILED: /tmp/stem_test/lib/python3.7/site-packages/ does NOT support .pth files
      error: bad install directory or PYTHONPATH
    
      You are attempting to install a package to a directory that is not
      on PYTHONPATH and which Python does not read ".pth" files from.  The
      installation directory you specified (via --install-dir, --prefix, or
      the distutils default setting) was:
    
          /tmp/stem_test/lib/python3.7/site-packages/
    
      and your PYTHONPATH environment variable currently contains:
    
          ''
    
      Here are some of your options for correcting the problem:
    
      * You can choose a different installation directory, i.e., one that is
        on PYTHONPATH or supports .pth files
    
      * You can add the installation directory to the PYTHONPATH environment
        variable.  (It must then also be on PYTHONPATH whenever you run
        Python and want to use the package(s) you are installing.)
    
      * You can set up the installation directory to support ".pth" files by
        using one of the approaches described here:
    
        https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations
    
      Please make the appropriate changes for your system and try again.
---
 test/integ/installation.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/integ/installation.py b/test/integ/installation.py
index 98856622..01c99caa 100644
--- a/test/integ/installation.py
+++ b/test/integ/installation.py
@@ -72,7 +72,7 @@ class TestInstallation(unittest.TestCase):
 
     try:
       try:
-        stem.util.system.call('%s setup.py install --prefix %s' % (PYTHON_EXE, BASE_INSTALL_PATH), timeout = 60, cwd = test.STEM_BASE)
+        stem.util.system.call('%s setup.py install --prefix %s' % (PYTHON_EXE, BASE_INSTALL_PATH), timeout = 60, cwd = test.STEM_BASE, env = {'PYTHONPATH': BASE_INSTALL_PATH})
         stem.util.system.call('%s setup.py clean --all' % PYTHON_EXE, timeout = 60, cwd = test.STEM_BASE)  # tidy up the build directory
 
         if platform.python_implementation() == 'PyPy':
@@ -80,7 +80,7 @@ class TestInstallation(unittest.TestCase):
         else:
           site_packages_paths = glob.glob('%s/lib*/*/site-packages/*' % BASE_INSTALL_PATH)
       except stem.util.system.CallError as exc:
-        msg = ["Unable to install with 'python setup.py install': %s" % exc]
+        msg = ["Unable to install with '%s': %s" % (exc.command, exc.msg)]
 
         if exc.stdout:
           msg += [



More information about the tor-commits mailing list