New Template for CKAN Extensions
We’ve just merged a new template for CKAN extensions. Whenever you create a new CKAN extension using the
paster --plugin=ckan create -t ckanext ... command (as documented in the writing extensions tutorial) it’ll now use the new template, which gives you:
- PyPI integration –
MANIFEST.infiles are automatically generated for your extension, ready for publishing to PyPI
- A tests directory including stub tests for you to get started writing tests for your extension
- Travis CI integration – automatically run your tests in a clean environment each time you push a new commit to GitHub. A
.travis.ymlfile and build and run scripts are automatically generated for your extension, you still need to log in to Travis and click the switch to turn on Travis for your extension though.
- Coveralls.io integration – track the code coverage of your tests. A
.coveragercfile is automatically generated for your extension. Again, you still need to login to Coveralls and turn it on.
LICENSEfile (uses the GNU AGPL by default)
- A reStructuredText
READMEfile with a skeleton documentation structure including generated installation and configuration instructions, how to run the tests, etc
- Travis, Coveralls and pypip.in README badges! Show the world that you have continuous integration, good test coverage, PyPI downloads, and your extension’s supported Python version, development status and license.
For an example of an extension built using this template, look at ckanext-deadoralive.
What we’re trying to do with this new template is:
- Save ourselves time, by not having to manually create all of this boilerplate every time we roll a new CKAN extension
- Help improve the quality of CKAN extensions by encouraging developers to write good tests and documentation, and to use services PyPI, Travis and Coveralls
More to come. If you have any ideas for things to add to the CKAN extension template, let us know on ckan-dev