From 5586ba7643e608827fc7109a40e851f3cae0f2e4 Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Sat, 30 Jan 2016 12:34:12 +0200 Subject: [PATCH] Simply docstrings of venv module This will hopefully make maintenance of venv documentation easier. For example, see commits a4f0d76af176 and 5764cc02244d. This patch has been reviewed by Vinaj Sajip, the maintainer of venv module. --- Lib/venv/__init__.py | 40 +--------------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py index 74245abbb2a..fa3d2a30567 100644 --- a/Lib/venv/__init__.py +++ b/Lib/venv/__init__.py @@ -3,28 +3,6 @@ Virtual environment (venv) package for Python. Based on PEP 405. Copyright (C) 2011-2014 Vinay Sajip. Licensed to the PSF under a contributor agreement. - -usage: python -m venv [-h] [--system-site-packages] [--symlinks] [--clear] - [--upgrade] - ENV_DIR [ENV_DIR ...] - -Creates virtual Python environments in one or more target directories. - -positional arguments: - ENV_DIR A directory to create the environment in. - -optional arguments: - -h, --help show this help message and exit - --system-site-packages - Give the virtual environment access to the system - site-packages dir. - --symlinks Attempt to symlink rather than copy. - --clear Delete the contents of the environment directory if it - already exists, before environment creation. - --upgrade Upgrade the environment directory to use this version - of Python, assuming Python has been upgraded in-place. - --without-pip Skips installing or upgrading pip in the virtual - environment (pip is bootstrapped by default) """ import logging import os @@ -349,23 +327,7 @@ class EnvBuilder: def create(env_dir, system_site_packages=False, clear=False, symlinks=False, with_pip=False): - """ - Create a virtual environment in a directory. - - By default, makes the system (global) site-packages dir *un*available to - the created environment, and uses copying rather than symlinking for files - obtained from the source Python installation. - - :param env_dir: The target directory to create an environment in. - :param system_site_packages: If True, the system (global) site-packages - dir is available to the environment. - :param clear: If True, delete the contents of the environment directory if - it already exists, before environment creation. - :param symlinks: If True, attempt to symlink rather than copy files into - virtual environment. - :param with_pip: If True, ensure pip is installed in the virtual - environment - """ + """Create a virtual environment in a directory.""" builder = EnvBuilder(system_site_packages=system_site_packages, clear=clear, symlinks=symlinks, with_pip=with_pip) builder.create(env_dir)