Skip to content

Commit

Permalink
Use pip install --force-reinstall flag
Browse files Browse the repository at this point in the history
Under some conditions, pip appears to wrongly think the packages is
available in the environment, so tell it to install it always.

Closes #805
  • Loading branch information
pv committed May 12, 2019
1 parent ae5f198 commit d0224d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions asv/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/asv.conf.json.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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}"],
Expand Down

0 comments on commit d0224d3

Please sign in to comment.