Skip to main content

pyutilib.virtualenv README

This Python package includes the vpy_create script, which is used to create virtualenv bootstrap scripts that automate the installation of virtualenv along with other Python packages.

Getting Started

Overview

The vpy_create script integrates a Python module into a virtualenv bootstrap script. A user defines a configure() function in this module to control the configuration of the virtualenv installation. For example, the following function declares the default installation directory, and that the virtual Python repository contains the virtualenv and nose Python packages:

def configure(installer):
      installer.default_dirname = 'venv'
      installer.add_repository('virtualenv', pypi='virtualenv')
      installer.add_repository('nose', pypi='nose')
      installer.add_repository(
          'pyutilib.subprocess',
          root='https://software.sandia.gov/svn/public/pyutilib.subprocess',
          dev=True)
      return installer

The add_repository method can specify a PyPI package with the pypi option. Alternatively, the root of a subversion repository can be specified with the root option. If the dev option is specified, then this repository is checked out and installed in the <root>/src directory. Further, this package is installed in develop mode.

A virtual Python bootstrap script is created by calling vpy_create and specifying the Python module and script name.:

vpy_create venv.py venv_install

The bootstrap script, venv_install, creates the virtual Python installation in the specified directory, venv:

venv_install

The user can also specify the installation directory:

venv_install venvdir

By default, the bootstrap script installs the latest software release. In PyPI, this is the latest revision. In subversion, this is the latest revision in either the tags or releases directory. The trunk branch of the subversion repository can also be installed using the –trunk option:

venv_install --trunk venv

Similarly, the bootstrap script recognizes stable branches, which can be installed with the –stable option. Note that if stable branches are not available, then the latest release is installed.

Internet Connectivity

By default, the bootstrap script uses an internet connection to download the Python packages that are installed. Note that a proxy server may be needed for the bootstrap script to work correctly. The user can define the HTTP_PROXY environmental variable to specify the name of a proxy server. Alternatively, the –proxy option can be specified.

The bootstrap script also provides a mechanism for enabling offline virtualenv installations. This requires a two-stage process. First, the –preinstall option is used to create a ZIP file that contains the Python packages. For example, the command:

venv_install --preinstall

creates a venv directory, which includes the file venv/venv.zip. The preinstall step must be executed on a machine with internet connectivity. However, this ZIP file can be used to perform an off-line installation with the –offline option. For example, the following command will uses the venv.zip file to perform off-line installation in the temp directory:

venv_install --offline --zip=venv.zip test

Note that this technique also installs the setuptools packages offline. Thus, the bootstrap script generated by vpy_create supports a purely offline setup of virtualenv environments, which is not supported by the virtualenv bootstrap process.

A Configurable Installer

The vpy_install script provided with pyutilib.virtualenv is a virtualenv bootstrap script that can be configured with INI files. For example, the consider the following INI file:

;
; This INI file can be used by vpy_install to create a virtual
; Python installation.
;
[installer]
description=This is an example.
README="#
 # This is a README file created by the bootstrap script.
 #"

[nose]
pypi=nose

[pyutilib.subprocess]
root=https://software.sandia.gov/svn/public/pyutilib/pyutilib.subprocess
dev=True

The default installation directory for vpy_install is python. This INI file will install the nose and pyutilib.subprocess packages, and the pyutilib.subprocess package will be installed in python/src/pyutilib.subprocess as an editable develop package.

Note that vpy_install does not require a user to install setuptools. The setuptools package is only required when the –preinstall option is specified. Thus, the default behavior of vpy_install (and other bootstrap scripts) does not require the installation of any third-party packages. The vpy_install script can be distributed independent of pyutilib.virtualenv, and it can generally be used as a stand-alone script.

The vpy_install script supports an –update option that allows the user to update virtual Python installations. This option does the following updates:

  • PyPI packages are upgraded

  • Subversion packages are updated and reinstalled

Note that this option does not search for a newer release of a subversion package. This limitation reflects the manner in which subversion packages are checked out within the virtual Python installation, which may be revised in the future.

License

BSD. See the LICENSE.txt file.

Organization

Third Party Software

The pyutilib.virtualenv package depends on the following Python packages:
  • virtualenv

Metadata

Release files for pyutilib.virtualenv 4.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyutilib.virtualenv 4.7
File Size Uploaded
pyutilib.virtualenv-4.7.tar.gz 7.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyutilib.virtualenv 4.7
File Interpreter ABI Platform
pyutilib.virtualenv-4.7-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 14.4 MB

Release files / pyutilib.virtualenv-4.7.tar.gz

Download URL pyutilib.virtualenv-4.7.tar.gz
Size 7.2 MB
Tags Source
SHA-256 checksum
How to use checksums
a547244ef7d5c198166d923e391dea4b4fcb8f52f51555c8f8ba2fa45bf433d8
BLAKE2b-256 checksum
How to use checksums
527de84ab9282b6be28dbc192a70e1ca6b1b827cdb7497fb8cb419b5704737e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pyutilib.virtualenv-4.7-py2.py3-none-any.whl

Download URL pyutilib.virtualenv-4.7-py2.py3-none-any.whl
Size 7.2 MB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
6fe5e77bad120dd834ca8789893e1993746a258a8afb4a6c5af979f1ef3f95fd
BLAKE2b-256 checksum
How to use checksums
dd661681677c546de0a449b5c329597c28b3d79088f729fb4e2414c9b4bd15d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

4.7 This release

2 release files

4.5.1

2 release files

4.5

2 release files

4.4

1 release file

4.3.4

2 release files

4.2

1 release file

4.0.1

1 release file

4.0

1 release file

3.3

1 release file

3.2

1 release file

3.1.1

1 release file

3.1

1 release file

3.0

1 release file

2.9

1 release file

2.8

1 release file

2.7

1 release file

2.5

1 release file

2.4.1

1 release file

2.4

1 release file

2.3

1 release file

2.2

1 release file

2.1

1 release file

2.0.1

1 release file

2.0

1 release file

1.5.1

1 release file

1.5

1 release file

1.4.3

1 release file

1.4.2

1 release file

1.4.1

1 release file

1.3.1

1 release file

1.3

1 release file

1.2.1

1 release file

1.2

1 release file

1.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page