Developing BowerStatic

Install BowerStatic for development

First make sure you have virtualenv installed for Python 2.7.

Now create a new virtualenv somewhere for BowerStatic development:

$ virtualenv /path/to/ve_bowerstatic

You should also be able to recycle an existing virtualenv, but this guarantees a clean one. Note that we skip activating the environment here, as this is just needed to initially bootstrap the BowerStatic buildout.

Clone BowerStatic from github and go to the bowerstatic directory:

$ git clone
$ cd bowerstatic

Now we need to run to set up buildout, using the Python from the virtualenv we’ve created before:

$ python /path/to/ve_bowerstatic/bin/python/

This installs buildout, which can now set up the rest of the development environment:

$ bin/buildout

This downloads and installs various dependencies and tools. The commands you run in bin are all restricted to the virtualenv you set up before. There is therefore no need to refer to the virtualenv once you have the development environment going.

Running the tests

You can run the tests using py.test. Buildout has installed it for you in the bin subdirectory of your project:

$ bin/py.test bowerstatic

To generate test coverage information as HTML do:

$ bin/py.test bowerstatic --cov bowerstatic --cov-report html

You can then point your web browser to the htmlcov/index.html file in the project directory and click on modules to see detailed coverage information.


The buildout also installs flake8, which is a tool that can do various checks for common Python mistakes using pyflakes and checks for PEP8 style compliance.

To do pyflakes and pep8 checking do:

$ bin/flake8 bowerstatic


The buildout installs radon. This is a tool that can check various measures of code complexity.

To check for cyclomatic complexity (excluding the tests):

$ bin/radon cc bowerstatic -e "bowerstatic/tests*"

To filter for anything not ranked A:

$ bin/radon cc bowerstatic --min B -e "bowerstatic/tests*"

And to see the maintainability index:

$ bin/radon mi bowerstatic -e "bowerstatic/tests*"