The purpose of this project is to create a template for other python projects.
The idea is to create a list of guidelines that all projects try should follow. This should help to standardise projects and make them easy to use and contribute to.
Ideally repositories should:
- have a basic description about its purpose/function
- be easy to run
- be easy to test
- be easy to debug
- be containerised
- be tidy (minimal amount of files in project root)
This project provides a Makefile with short commands to run common tasks.
make helpRun this for a full list of commands.
make startThis command will build and/or run the site locally configured for development purposes.
make stopUse this command to stop containers and clean up any anonymous volumes.
make testsUse this command to run unit tests.
make checksUse this command to run static checks such as: mypy, flake8, pylint.
make all-testsCombines the two commands above by running all checks followed by unit tests
The following commands update files that keep track of project dependencies.
make buildRun this if you would like to persist changes to dependencies to your docker container.
make dependency package=<package name>
make dev-dependency package=<package name>
# examples:
make dependency package=flask
make dependency package=flask==1.0.2
make dev-dependency package=pytestRun either of these commands to add a python package as a project dependency or development dependency alike. You can specify just the package name to get the latest version or specify a specific version number.
make remove-dependency package=<package name>
make remove-dev-dependency package=<package name>Run either of these commands to remove dependencies accordingly.
make runUse this command to only run the python service. It is possible to use pdb breakpoints with this configuration.
make shellUse this to run the python container that would run the application and enter a bash prompt.
make dependency-tree
# or
make d-treeUse this to display a dependency tree
make fix-importsWhen checks are run warnings are displayed because imports do not follow the
project conventions as specified in setup.cfg under [isort].
Use this command to automatically fix imports for all project python files.