1
0
mirror of https://github.com/certbot/certbot.git synced 2026-01-26 07:41:33 +03:00
Files
certbot/tools/venv3.py
Brad Warren 944d0e05c8 Use venv over virtualenv in venv3 (#6922)
Fixes #6861.

_venv_common.py is no longer executable. The reason for this is the venv creation logic is now different between Python 2 and Python 3. We could add code that branches on the Python version running the script, but I personally think that's unnecessary.

--setuptools and --no-site-packages is no longer passed to virtualenv either. These flags were made noops in virtualenv 1.10 and 1.7 respectively, but all of CentOS 6, 7, Debian 8+, and Ubuntu 14.04+ have new enough versions of virtualenv where these flags are no longer necessary. They are not even accepted as flags to Python 3's venv module.

Use of VENV_ARGS from test_sdists.sh was also removed because that environment variable hasn't done anything in a while.

I ran test farm tests on test_apache2.sh and test_sdists.sh with these changes and they passed.

* Fixes #6861.

* _venv_common is no longer executable.
2019-04-05 15:01:09 -07:00

27 lines
633 B
Python
Executable File

#!/usr/bin/env python3
# Developer virtualenv setup for Certbot client
import sys
import _venv_common
def create_venv(venv_path):
"""Create a Python 3 virtual environment at venv_path.
:param str venv_path: path where the venv should be created
"""
python3 = _venv_common.find_python_executable(3)
command = [python3, '-m', 'venv', venv_path]
_venv_common.subprocess_with_print(command)
def main(pip_args=None):
venv_path = _venv_common.prepare_venv_path('venv3')
create_venv(venv_path)
_venv_common.install_packages(venv_path, pip_args)
if __name__ == '__main__':
main(sys.argv[1:])