Requirements:
- Python 3.12+
- Poetry
poetry install --with dev
poetry shell
pre-commit installStatic analysis utilizes following external tools
ruffbanditmypy
To run the static analysis manually execute the following commands:
# Run ruff with auto-fix
ruff check --fix
# Run ruff with auto-format
ruff format
# Run bandit
bandit -c pyproject.toml -r .
# Run mypy
mypy .Ruff will run automatically on save in VSCode.
Alternatively, run pre-commit run -a to run all the checks at once.
Unit tests utilize following external tools
pytestpytest-cov
In order to execute the unit tests run pytest --cov=src tests.
cp .env.example .env
vim .env # Change all required values
docker build -t py-generic-boilerplate .
docker run --rm --env-file .env py-generic-boilerplatePR workflow is located at .github/workflows/pr.yaml and does the following:
- Installs Python
- Install dependencies
- Runs pre-commit
- Runs unit tests