Extending Cookiedozer

Create an Installable Package

First we need to create a  setup.py file at the root level of our package:

Starting from the examples at the setuptools docs we’ll adjust the setup to our needs. It is little surprise what are going to do next 🙂

After inserting the variables from the cookiecutter.json, I did some further adjustments such as adding keywords, classifiers and an entry point. You can find a comprehensive list of the classifiers at pypi. Most importantly though I added a PyTest command to be able to invoke the test suite by running python setup.py test, compare pytest integration practices.

But see for yourself:

To easily include data files such as the readme and the license file you want to create a  MANIFEST.in with the follwing content next to your setup.py.

Create a Virtual Environment

I highly recommend virtualenvwrapper to manage your virtual environments, simply because it makes working on several projects super convenient. Given that you successfully installed the wrapper you can run the following set of commands:

We generate a new project (I went with the default repository name ‘helloworld’), create and activate a new virtual environment with the same name and connect the current working directory with the env. Finally I enable the global site packages in the virtual environment as I installed kivy to my systems’ python.

Install the app

By using the ‘develop’ command instead of ‘install’ we can change our application code without the need to upgrade the package.

Run it via Console Script

Due to the entry point we added to the setup script we can launch the app with a single command 😀

Invoke py.test Test Suite

Running the test suite is just as easy.

In the last part of this tutorial we are going to setup a sphinx based documentation as well as a buildozer spec to deploy the app to an android mobile device.

Last of all we will wrap up this tutorial with a Makefile to combine the most important commands. 😎

As always you can find the latest version of my template at