Project "skeleton" provides a simple template for python based projects. It's based on the following technologies:
dockerto provide an isolated python runtime./Dockerfile- requires
dockerand its dependencies to be installed on the developer's machine
docker-composeto define the full development environment together with service containers, networking, etc../docker-compose.yaml- requires
docker-composeto be installed on the developer's machine - use
LD_LIBRARY_PATH=/usr/local/lib docker-compose up -d --buildto build the app image - use
docker-compose run --rm appto exec into a dev container
setuptoolsto define the application package./setup.pyholds the project metadata
pipto install the application dependencies- run
pip install --editable .to install the application package into the dev environment
- run
pip-toolsfor dependency resolution and pinning./setup.pyspecifies the app's dependencies./requirements-dev.inspecifies dev dependencies./scripts/dep_lock.shresolves the dependencies and creates a lock file./scripts/dep_sync.shinstall the resolved dependencies into the dev environment
pipxto install python-based development tools isolated./Dockerfilelists the tools to be installed when the app image is built
isortandblack(both installed viapipx) to format the code./pyproject.tomlcontains the configuration./scripts/format.shruns bothisortandblack
bandit(installed viapipx) to check for unsafe code- use
./scripts/lint.shto run the checks
- use
safety(installed viapipx) to check the dependencies for known vulnerabilities- use
./scripts/lint.shto run the checks
- use
pylintto check code conventions./scripts/pylint.inicontains the configuration- use
./scripts/lint.shto run the checks
mypyto perform static type checking./scripts/mypy.inicontains the configuration- use
./scripts/lint.shto run the checks
pytestas the unit testing framework (installed withpytest-covandpytest-mockplugins)./pyproject.tomlcontains the configuration./scripts/tests.shruns the tests
coverateto gather branch coverage statistics./pyproject.tomlcontains the configuration./scripts/tests.shrunscoverageviapytest
- setup github actions
- update source files in place when running
isort(to avoid permission changes) - run editable install automatically on container start