Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/certbot/certbot.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tools/venv3.py')
-rwxr-xr-xtools/venv3.py54
1 files changed, 24 insertions, 30 deletions
diff --git a/tools/venv3.py b/tools/venv3.py
index c2374ba5a..7ead82bd5 100755
--- a/tools/venv3.py
+++ b/tools/venv3.py
@@ -1,36 +1,30 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Developer virtualenv setup for Certbot client
+import sys
+
import _venv_common
-REQUIREMENTS = [
- '-e acme[dev]',
- '-e .[dev,docs]',
- '-e certbot-apache',
- '-e certbot-dns-cloudflare',
- '-e certbot-dns-cloudxns',
- '-e certbot-dns-digitalocean',
- '-e certbot-dns-dnsimple',
- '-e certbot-dns-dnsmadeeasy',
- '-e certbot-dns-gehirn',
- '-e certbot-dns-google',
- '-e certbot-dns-linode',
- '-e certbot-dns-luadns',
- '-e certbot-dns-nsone',
- '-e certbot-dns-ovh',
- '-e certbot-dns-rfc2136',
- '-e certbot-dns-route53',
- '-e certbot-dns-sakuracloud',
- '-e certbot-nginx',
- '-e certbot-postfix',
- '-e letshelp-certbot',
- '-e certbot-compatibility-test',
-]
-
-
-def main():
- venv_args = '--python "{0}"'.format(_venv_common.find_python_executable(3))
- _venv_common.main('venv3', venv_args, REQUIREMENTS)
+
+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)
+
+ if not pip_args:
+ pip_args = _venv_common.REQUIREMENTS + ['-e certbot[dev3]']
+
+ _venv_common.install_packages(venv_path, pip_args)
if __name__ == '__main__':
- main()
+ main(sys.argv[1:])