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

virtualenv --clear options #46

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion fabtools/require/python.py
Expand Up @@ -89,7 +89,7 @@ def requirements(filename, **kwargs):
install_requirements(filename, **kwargs)


def virtualenv(directory, system_site_packages=False, python=None, use_sudo=False, user=None):
def virtualenv(directory, system_site_packages=False, python=None, use_sudo=False, user=None, clear=False):
"""
Require a Python `virtual environment`_.

Expand All @@ -106,8 +106,12 @@ def virtualenv(directory, system_site_packages=False, python=None, use_sudo=Fals
options = ['--quiet']
if system_site_packages:
options.append('--system-site-packages')
else:
options.append('--no-site-packages')
if python:
options.append('--python=%s' % python)
if clear:
options.append('--clear')
options = ' '.join(options)
command = 'virtualenv %(options)s "%(directory)s"' % locals()
if use_sudo:
Expand Down