Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argument list for "python -m virtualenv" without empty strings #7330

Merged
merged 3 commits into from
Jul 29, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 22 additions & 10 deletions readthedocs/doc_builder/python_environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,19 +295,31 @@ def venv_path(self):
return os.path.join(self.project.doc_path, 'envs', self.version.slug)

def setup_base(self):
site_packages = ''
"""
Create a virtualenv, invoking python -m virtualenv
benjaoming marked this conversation as resolved.
Show resolved Hide resolved

.. note::

``--no-download`` was removed because of the pip breakage,
it was sometimes installing pip 20.0 which broke everything
https://github.com/readthedocs/readthedocs.org/issues/6585

Important not to add empty string arguments, see:
https://github.com/readthedocs/readthedocs.org/issues/7322
"""
cli_args = [
'-mvirtualenv',
]
if self.config.python.use_system_site_packages:
site_packages = '--system-site-packages'
env_path = self.venv_path()
cli_args.append('--system-site-packages')

# Append the positional destination argument
cli_args.append(
self.venv_path(),
)
self.build_env.run(
self.config.python_interpreter,
'-mvirtualenv',
site_packages,
# This is removed because of the pip breakage,
# it was sometimes installing pip 20.0 which broke everything
# https://github.com/readthedocs/readthedocs.org/issues/6585
# '--no-download',
env_path,
*cli_args,
# Don't use virtualenv bin that doesn't exist yet
bin_path=None,
# Don't use the project's root, some config files can interfere
Expand Down