PackageCommand - evansde77/cirrus GitHub Wiki

Package Command

Release 1.6 and above The cirrus package command provides support for setting up cirrus to work in a new package.

package init

Assuming a starting point of a git repo with at least one commit on the master branch, you can run the git cirrus package init command to add the various configuration and packaging files used by cirrus. This is intended to provide a minimal working template, so some configuration post init will be needed to take advantage of other features.

The init command will do the following:

  1. set up the develop/master branches for gitflow style work
  2. generate a MANIFEST.in file containing the necessary include statements for packaging with setuptools
  3. adds the default cirrus setup.py file
  4. Generates a basic cirrus.conf file for the package
  5. sets up the version number management and history file generation

For example:

# create a minimal repo 
mkdir test_repo
cd test_repo
git init 
echo 'readme' > README
git add README
git commit -m 'add README; first commit on master'
git checkout -b develop 
mkdir -p src/throwaway
echo "__version__ = '0.0.0'" > src/throwaway/__init__.py
echo "requests" > requirements.txt
git add src/throwaway/__init__.py requirements.txt
git commit -m "make a package"
git checkout master
git merge develop

# run the package init command
git cirrus package init -p test_repo --no-remote -v 0.0.0 -s src --version-file=src/throwaway/__init__.py 
# can now use cirrus in the package, eg build:  
git cirrus build

Options available for the package init command:

  • --repo, -r - Path to repo, defaults to pwd
  • --source-dir -s Additional directory structure within package for source code eg if you put your source code in a src subdir in the repo. Assumes repo top level directory if not set
  • --package, -p cirrus package name (Required)
  • --version, -v initial package version
  • --organization, -o Organization name to include in package (Eg, Github org or username)
  • --description, -d Package description
  • --templates, additional template rules to include in MANIFEST, eg include src/templates/*.json
  • --version-file, Version file, defaults to package init.py, where to update the __version__ attribute
  • --history-file, changelog history filename, defaults to HISTORY.md
  • --requirements, requirements file for pip defaults to requirements.txt
  • --master-branch, GitFlow master branch, defaults to master
  • --develop-branch, GitFlow develop branch, defaults to develop
  • --use-pypirc, read ~/.pypirc and generate extra-index-url entries for any repos found there
  • --register-with-pypi , Register the new package with the provided pypi url, can be a full URL or alias from .pypirc
  • --no-remote, disable pushing changes to remote, commit locally only

package container-init

The container-init command generates templates used by the DockerImageCommand to build images from the package as part of a release process

package project

The project command generates project files in the package for various IDEs and editors.

⚠️ **GitHub.com Fallback** ⚠️