Skip to content

Commit

Permalink
Merge pull request #5107 from stsewd/use-python-from-virtualenv
Browse files Browse the repository at this point in the history
Use python from virtualenv's bin directory when executing commands
  • Loading branch information
ericholscher authored Jan 15, 2019
2 parents f28c236 + 5af2d8e commit a972eb1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
.DS_Store
.cache
.coverage
.coverage.*
.idea
.vagrant
.vscode
Expand All @@ -22,7 +23,7 @@ celerybeat-schedule.*
deploy/.vagrant
dist/*
local_settings.py
locks/*
locks/**
logs/*
media/dash
media/epub
Expand Down
17 changes: 10 additions & 7 deletions readthedocs/doc_builder/python_environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ def install_package(self):
','.join(self.config.python.extra_requirements)
)
self.build_env.run(
'python',
self.venv_bin(filename='pip'),
self.venv_bin(filename='python'),
'-m',
'pip',
'install',
'--ignore-installed',
'--cache-dir',
Expand All @@ -89,7 +90,7 @@ def install_package(self):
)
elif self.config.python.install_with_setup:
self.build_env.run(
'python',
self.venv_bin(filename='python'),
'setup.py',
'install',
'--force',
Expand Down Expand Up @@ -229,8 +230,9 @@ def setup_base(self):
def install_core_requirements(self):
"""Install basic Read the Docs requirements into the virtualenv."""
pip_install_cmd = [
'python',
self.venv_bin(filename='pip'),
self.venv_bin(filename='python'),
'-m',
'pip',
'install',
'--upgrade',
'--cache-dir',
Expand Down Expand Up @@ -308,8 +310,9 @@ def install_user_requirements(self):

if requirements_file_path:
args = [
'python',
self.venv_bin(filename='pip'),
self.venv_bin(filename='python'),
'-m',
'pip',
'install',
]
if self.project.has_feature(Feature.PIP_ALWAYS_UPGRADE):
Expand Down
10 changes: 6 additions & 4 deletions readthedocs/rtd_tests/tests/test_doc_building.py
Original file line number Diff line number Diff line change
Expand Up @@ -1166,8 +1166,9 @@ def setUp(self):
]

self.pip_install_args = [
'python',
mock.ANY, # pip path
mock.ANY, # python path
'-m',
'pip',
'install',
'--upgrade',
'--cache-dir',
Expand Down Expand Up @@ -1256,8 +1257,9 @@ def test_install_user_requirements(self, checkout_path):
os.path.join(checkout_path, 'docs'): True,
}
args = [
'python',
mock.ANY, # pip path
mock.ANY, # python path
'-m',
'pip',
'install',
'--exists-action=w',
'--cache-dir',
Expand Down

0 comments on commit a972eb1

Please sign in to comment.