@@ -167,29 +167,29 @@ creation according to their needs, the :class:`EnvBuilder` class.
167
167
The :class: `EnvBuilder ` class accepts the following keyword arguments on
168
168
instantiation:
169
169
170
- * `` system_site_packages `` -- a Boolean value indicating that the system Python
170
+ * * system_site_packages * -- a boolean value indicating that the system Python
171
171
site-packages should be available to the environment (defaults to ``False ``).
172
172
173
- * `` clear `` -- a Boolean value which, if true, will delete the contents of
173
+ * * clear * -- a boolean value which, if true, will delete the contents of
174
174
any existing target directory, before creating the environment.
175
175
176
- * `` symlinks `` -- a Boolean value indicating whether to attempt to symlink the
176
+ * * symlinks * -- a boolean value indicating whether to attempt to symlink the
177
177
Python binary rather than copying.
178
178
179
- * `` upgrade `` -- a Boolean value which, if true, will upgrade an existing
179
+ * * upgrade * -- a boolean value which, if true, will upgrade an existing
180
180
environment with the running Python - for use when that Python has been
181
181
upgraded in-place (defaults to ``False ``).
182
182
183
- * `` with_pip `` -- a Boolean value which, if true, ensures pip is
183
+ * * with_pip * -- a boolean value which, if true, ensures pip is
184
184
installed in the virtual environment. This uses :mod: `ensurepip ` with
185
185
the ``--default-pip `` option.
186
186
187
- * `` prompt `` -- a String to be used after virtual environment is activated
187
+ * * prompt * -- a string to be used after virtual environment is activated
188
188
(defaults to ``None `` which means directory name of the environment would
189
189
be used). If the special string ``"." `` is provided, the basename of the
190
190
current directory is used as the prompt.
191
191
192
- * `` upgrade_deps `` -- Update the base venv modules to the latest on PyPI
192
+ * * upgrade_deps * -- Update the base venv modules to the latest on PyPI
193
193
194
194
.. versionchanged :: 3.4
195
195
Added the ``with_pip `` parameter
@@ -200,10 +200,7 @@ creation according to their needs, the :class:`EnvBuilder` class.
200
200
.. versionchanged :: 3.9
201
201
Added the ``upgrade_deps `` parameter
202
202
203
- Creators of third-party virtual environment tools will be free to use the
204
- provided :class: `EnvBuilder ` class as a base class.
205
-
206
- The returned env-builder is an object which has a method, ``create ``:
203
+ :class: `EnvBuilder ` may be used as a base class.
207
204
208
205
.. method :: create(env_dir)
209
206
@@ -303,37 +300,27 @@ creation according to their needs, the :class:`EnvBuilder` class.
303
300
304
301
.. method :: upgrade_dependencies(context)
305
302
306
- Upgrades the core venv dependency packages (currently `` pip ` `)
303
+ Upgrades the core venv dependency packages (currently :pypi: ` pip `)
307
304
in the environment. This is done by shelling out to the
308
305
``pip `` executable in the environment.
309
306
310
307
.. versionadded :: 3.9
311
308
.. versionchanged :: 3.12
312
309
313
- `` setuptools ` ` is no longer a core venv dependency.
310
+ :pypi: ` setuptools ` is no longer a core venv dependency.
314
311
315
312
.. method :: post_setup(context)
316
313
317
314
A placeholder method which can be overridden in third party
318
315
implementations to pre-install packages in the virtual environment or
319
316
perform other post-creation steps.
320
317
321
- .. versionchanged :: 3.7.2
322
- Windows now uses redirector scripts for ``python[w].exe `` instead of
323
- copying the actual binaries. In 3.7.2 only :meth: `setup_python ` does
324
- nothing unless running from a build in the source tree.
325
-
326
- .. versionchanged :: 3.7.3
327
- Windows copies the redirector scripts as part of :meth: `setup_python `
328
- instead of :meth: `setup_scripts `. This was not the case in 3.7.2.
329
- When using symlinks, the original executables will be linked.
330
-
331
- In addition, :class: `EnvBuilder ` provides this utility method that can be
332
- called from :meth: `setup_scripts ` or :meth: `post_setup ` in subclasses to
333
- assist in installing custom scripts into the virtual environment.
334
-
335
318
.. method :: install_scripts(context, path)
336
319
320
+ This method can be
321
+ called from :meth: `setup_scripts ` or :meth: `post_setup ` in subclasses to
322
+ assist in installing custom scripts into the virtual environment.
323
+
337
324
*path * is the path to a directory that should contain subdirectories
338
325
"common", "posix", "nt", each containing scripts destined for the bin
339
326
directory in the environment. The contents of "common" and the
@@ -358,6 +345,16 @@ creation according to their needs, the :class:`EnvBuilder` class.
358
345
The directories are allowed to exist (for when an existing environment
359
346
is being upgraded).
360
347
348
+ .. versionchanged :: 3.7.2
349
+ Windows now uses redirector scripts for ``python[w].exe `` instead of
350
+ copying the actual binaries. In 3.7.2 only :meth: `setup_python ` does
351
+ nothing unless running from a build in the source tree.
352
+
353
+ .. versionchanged :: 3.7.3
354
+ Windows copies the redirector scripts as part of :meth: `setup_python `
355
+ instead of :meth: `setup_scripts `. This was not the case in 3.7.2.
356
+ When using symlinks, the original executables will be linked.
357
+
361
358
There is also a module-level convenience function:
362
359
363
360
.. function :: create(env_dir, system_site_packages=False, clear=False, \
0 commit comments