mkbootstrap

This section provides detailed usage information for the mkbootstrap command.

Synopsis

mkbootstrap [OPTIONS]

Description

mkbootstrap is the command-line utility that generates a virtualenv bootstrap script and configuration file for a project. It is also used to upgrade the bootstrap script whenever newer versions of everyapp.bootstrap are installed.

Options

mkbootstrap accepts several command-line options that are described below. The basic options are the ones that are used most commonly. The advanced options are intended for special situations where more advanced customization is required.

Basic Options

The following are the most commonly used options of customizing the behaviour of mkbootstrap.

--version

This option tells mkbootstrap to just show program’s version and copyright information, and then exit.

-h, --help

This option tells mkbootstrap to just show program usage information and then exit. It lists all the options described here along with simple descriptions.

-s FILE_NAME, --script-name FILE_NAME

Use this option to give the generated bootstrap script a different name or location. The default is bootstrap.py.

Note

By default, the name of the generated configuration file will also change when this option is given. Use the -c option to override this behaviour.

-c FILE_NAME, --config-name FILE_NAME

Use this option to give the generated configuration file a different name or location. The default is the same as script name but with a .cfg extension.

Note

If you specify a custom location for the configuration file, you will need to always specify it when re-generating/upgrading the bootstrap script.

-e, --etc

Use this option to generate the configuration file in an etc sub-directory instead of in the current directory. This is useful if you want to keep all your project’s configuration files in a common place and not in the project’s root directory. etc is a common convention on POSIX systems.

Note

You can combine this option with the -c option to customize the configuration file name, but then you should not specify a custom location with that option.

-n, --no-customization

This option tells tells mkbootstrap to only generate a plain vanilla virtualenv bootstrap script, without any customizations or configuration file. The generated bootstrap script is exactly the same as if everyapp.bootstrap had never even been installed.

This option makes it easy to use everyapp.bootstrap as simply a virtualenv script generator without adding any extra fanciness. This is arguably a bit easier than creating your own bootstrap script generator as described in the virtualenv documentation.

Note

If you use this option, then the available command-line options of the generated bootstrap script will only be the original ones and not include the customized ones provided by this package.

Advanced Options

The options listed here are meant for more advanced customization needs. They allow you to fully customize the generated bootstrap script and configuration file.

-S FILE_NAME, --customize-script FILE_NAME

Normally, mkbootstrap includes it’s own virtualenv customization code in the generated bootstrap script to provide it’s additional functionality. You can use this option to have your own virtualenv customization code included instead. Just put your customization code in a file and reference it with this option. This is arguably a bit easier than creating your own bootstrap script generator as described in the virtualenv documentation.

Additionally, if you include the $DEFAULT_CONFIG_FILE_NAME$ token in your code, it will be automatically replaced with the name of the configuration file.

See also

The virtualenv documentation on creating custom bootstrap scripts for more information on what to put into your customization file.

-C FILE_NAME, --default-config FILE_NAME

Normally, mkbootstrap generates the configuration file from a built-in template. You can use this option, however, to use your own default configuration file instead.

Note

A new configuration file will not be generated if an existing one is already found.

Examples

The simplest and most common usage is to just run it in your project’s root directory. For example:

cd /path/to/my/project/root
mkbootstrap

This will generate a virtualenv bootstrap script called bootstrap.py and a configuration file called bootstrap.cfg in /path/to/my/project/root (i.e. the current directory).

Here are other examples:

mkboostrap -s bootdev.py

This will generate the files bootdev.py and bootdev.cfg in the current directory.

mkboostrap -c venv.cfg

This will generate the files bootstrap.py and venv.cfg in the current directory.

cd /path/to/my/project
mkbootstrap -e

This will generate the configuration file as /path/to/my/project/etc/bootstrap.cfg.

Files and Directories

bootstrap.py
The generated enhanced virtualenv bootstrap script
bootstrap.cfg
The configuration file for bootstrap.py

Exit Status

0
Successful program execution
1
Operational error
2
Error parsing command-line options