BuildCommand - evansde77/cirrus GitHub Wiki

Build Command

Note The Build Command internals switched over between version 2.3 and 2.4 to using Builder-Plugins. While the command change is backwards compatible, the plugin related options will only work with release 2.4 or later. If a Plugin is not specified, the default for your environment will be determined from how cirrus itself was installed and be either VirtualenvPipBuilder or CondaPipBuilder.

The build command creates a local package virtualenv, installs requirements and does a setup.py develop to create a working development environment for testing and writing code against. It looks for requirements files and uses pip to install them into the local package.

Usage

usage: build [-h] [-c] [-d [DOCS [DOCS ...]]] [--builder BUILDER] [-u]
             [--extra-requirements EXTRAS [EXTRAS ...]] [--no-setup-develop]
             [--python PYTHON]
             [command]

git cirrus build

positional arguments:
  command

optional arguments:
  -h, --help            show this help message and exit
  -c, --clean           remove existing virtual environment
  -d [DOCS [DOCS ...]], --docs [DOCS [DOCS ...]]
                        generate documentation with Sphinx (Makefile path must
                        be set in cirrus.conf.
  --builder BUILDER, -b BUILDER
                        Builder plugin to use to create dev environment
  -u, --upgrade         Use --upgrade to update the dependencies in the
                        package requirements
  --extra-requirements EXTRAS [EXTRAS ...]
                        extra requirements files to install
  --no-setup-develop
  --python PYTHON, -p PYTHON
                        Which python to use to create venv

Pre 2.4 Release

git cirrus build -h
usage: build [-h] [-c] [-d [DOCS [DOCS ...]]] [-u]
             [--extra-requirements EXTRAS [EXTRAS ...]]
             [--use-virtualenv USE_VENV] [--no-setup-develop]
             [--python PYTHON]
             [command]

git cirrus build

positional arguments:
  command

optional arguments:
  -h, --help            show this help message and exit
  -c, --clean           remove existing virtual environment
  -d [DOCS [DOCS ...]], --docs [DOCS [DOCS ...]]
                        generate documentation with Sphinx (Makefile path must
                        be set in cirrus.conf.
  -u, --upgrade         Use --upgrade to update the dependencies in the
                        package requirements
  --extra-requirements EXTRAS [EXTRAS ...]
                        extra requirements files to install
  --use-virtualenv USE_VENV
                        explicit virtualenv binary to use
  --no-setup-develop
  --python PYTHON, -p PYTHON
                        Which python to use to create venv

Examples

Basic Examples using the default builder plugin for your system

git cirrus build       # build the virtualenv & install dependencies
git cirrus build --upgrade # build and force updates of any dependencies that arent pinned 
git cirrus build --clean   # remove and rebuild the current virtualenv 
git cirrus build --python python3.5  # create the virtualenv using a specific python interpreter
git cirrus build --extra-requirements=test-requirements.txt # create the virtualenv and install additional packages

Examples specifying the BuilderPlugin:

git cirrus build --clean --builder=CondaEnv --environment=conda-environment.yml --upgrade  # Build using the CondaEnvBuilder using a conda environment file. 
git cirrus build --clean --builder=CondaPip  # Build using the CondaPipBuilder
git cirrus build --clean --builder=Conda --extra-requirements=conda-test-requirements.txt # Build using the CondaBuilder with extra requirements

Different builder plugins can also extend the command line options, see the Builder specific docs for details:

Configuration Options

In the build section of the package cirrus.conf you can specify the following options:

  • extra_requirements - additional requirements to install when creating the virtualenv beyond those in requirements.txt
  • python - which python interpreter to use in the virtualenv
  • pip_options - extra options such as local devpi urls for pip installing dependencies.
[build]
extra_requirements = test-requirements.txt
python=python3.5
pip_options = --extra-index-url http://localhost:4040/local/test --trusted-host localhost