bootstrap.cfg

This section provides detailed usage information for the bootstrap.cfg configuration file.

Description

bootstrap.cfg is the configuration file used by the bootstrap.py script to customize it’s behaviour when creating a virtualenv environment for a project. A default bootstrap.cfg is generated, along with the bootstrap.py script, by the mkbootstrap command.

bootstrap.cfg allows one to do the following:

  • Customize the default values of the command-line arguments to bootstrap.py,
  • List additional Python distributions to be installed using pip and/or easy_install, and
  • List additional commands to execute once everything else has been set up.

The bootstrap.cfg file is an ASCII text file, similar in format to INI files in that it is separated into sections in the form of [section_name]. Each section, however, can require a different line format and is not necessarily restricted to a set of key=value pairs.

The full default generated bootstrap.cfg text can be read in Appendix B: Default bootstrap.cfg.

Sections

Each section of the configuration file is described separately below:

[options]

In this section, one can override the default values of the command-line options that bootstrap.py accepts. The accepted options and their default values are listed below.

The format for this section is key = value pairs, one pair per line.

verbose = 0
This option corresponds to the --verbose command-line argument. A higher values means more detailed output.
quiet = 0
This option corresponds to the --quiet command-line argument. A higher value means less detailed output.
python =
This option corresponds to the --python command-line argument.
clear = False
This option corresponds to the --clear command-line argument. Set to it True to enable the option.
prompt =
This option corresponds to the --prompt command-line argument.
system_site_packages = False
This option corresponds to the --system-site-packages command-line argument. Set it to True to enable the option.
use_setuptools = False
This option corresponds to the --setuptools command-line argument. Set it to True to enable the option.
zip_setuptools = False
This option corresponds to the --zip-setuptools command-line argument. Set it to True to enable the option.
pip_install_options =
This option corresponds to the --pip-install-options command-line argument.
easy_install_options = -Z
This option corresponds to the --easy_install-options command-line argument.

See also

The bootstrap.py script documentation for more information on the specific purpose of each option.

Note

Hyphens (-) in option names on the command-line are replaced with underscores (_) internally. Use underscores in bootstrap.cfg as well.

[pip]

In this section, one can list any additional Python distributions to install automatically in the virtual environment using pip. These would normally only be the distributions needed for development support, not the dependencies of the project itself (which would go in setup.py).

The format for this section is one distribution per line, each specified either in PEP 314/PEP 345 format using parentheses or in pip-compatible format without parentheses. For example:

pep8 (>=0.5,!=0.5.2,<0.6)

or:

pep8>=0.5,!=0.5.2,<0.6

Note

Not all distributions are compatible with pip. Use the [easy_install] section below for those that are not (or use it for all distributions).

[easy_install]

In this section, like in the [pip] section above, one can list any additional Python distributions to install automatically in the virtual environment. However, distribution listed in this section will be installed using easy_install. Similarly, these would normally only be the distributions needed for development support.

The format for this section is the same as that of the [pip] section above.

[commands]

This section lets one automatically execute additional commands after the virtual environment has been created and all the specified distributions have been installed.

The format for this section is one command (with any arguments) per line.

Note

One can use the $bin$ token to indicate the virtual environment’s bin/ directory, which can have a different name on some platforms (e.g. Scripts\ on Windows). The trailing slash is also included.

For example:

$bin$python setup.py develop

Files and Directories

bootstrap.cfg
The default location and name for the configuration file for bootstrap.py, relative to the project’s root directory.
etc/bootstrap.cfg
A common alternative location and name for the configuration file for bootstrap.py, relative to the project’s root directory.