From 742049132cb3f9225d98daaa7ae629a538d29f58 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Fri, 5 Apr 2019 21:41:43 +0300 Subject: [PATCH] Use pip install --force-reinstall flag Under some conditions, pip appears to wrongly think the packages is available in the environment, so tell it to install it always. Closes #805 --- asv/environment.py | 6 ++++-- docs/source/asv.conf.json.rst | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/asv/environment.py b/asv/environment.py index 7d8911a41..43f396616 100644 --- a/asv/environment.py +++ b/asv/environment.py @@ -660,8 +660,10 @@ def _install_project(self, repo, commit_hash, build_dir): """ cmd = self._install_command if cmd is None: - # Run pip via python -m pip, avoids shebang length limit on Linux - cmd = ["python -mpip install {wheel_file}"] + # Run pip via python -m pip, avoids shebang length limit on Linux. + # Ensure --force-reinstall so that package being present e.g. on cwd + # does not mess things up. + cmd = ["python -mpip install --force-reinstall {wheel_file}"] if cmd: commit_name = repo.get_decorated_hash(commit_hash, 8) diff --git a/docs/source/asv.conf.json.rst b/docs/source/asv.conf.json.rst index 12f97a81d..b55b7f8f5 100644 --- a/docs/source/asv.conf.json.rst +++ b/docs/source/asv.conf.json.rst @@ -66,7 +66,7 @@ Airspeed Velocity rebuilds the project as needed, using these commands. The defaults are:: "install_command": - ["python -mpip install {wheel_file}"], + ["python -mpip install --force-reinstall {wheel_file}"], "uninstall_command": ["return-code=any python -mpip uninstall -y {project}"],