Development, Testing and Release Workflow

Developer Installation

First, create an isolated Python environment for this project with virtualenv, virtualenvwrapper or pyvenv. You can develop in Python 2.7 or Python 3.4+.

Then install LTD Mason and its dependencies with:

git clone https://git.com/lsst-sqre/ltd-mason.git  # or a fork
cd ltd-mason
pip install -r requirements.txt
python setup.py develop

Testing Framework

Tests are written for, and run through, py.test.

py.test --flake8 --cov=ltdmason

Performs unit tests, runs Flake8, and produces a unit test coverage report.

These tests are also run under Travis CI. On Travis some additional integration tests against AWS S3 are also run.

Coding Style

This project follows PEP 8.

Python Version Compatibility

This project is targeted for both Python 2.7 and Python 3.4+ version. We use the future package to achieve compatibility.

Generally speaking, you should write code for Python 3 and then achieve backwards compatibility by including the following imports:

from __future__ import (division, absolute_import, print_function,
                        unicode_literals)
from builtins import *  # NOQA
from future.standard_library import install_aliases
install_aliases()  # NOQA

Release Procedure

Ensure that the build is passing on Travis before preparing a release.

  1. Bump the version in setup.py, update the CHANGELOG (see http://keepachangelog.com) and commit the change.

    For version numbering, see PEP 386. E.g.

    • 0.1.0rc0
    • 0.1.0.dev0
  2. Tag:

    git tag -s -m "Verson 0.1.0rc0" v0.1.0rc0
    
  3. Build:

    rm -R dist
    python setup.py sdist bdist_wheel
    
  4. Upload:

    twine upload dist/*
    git push --tags