Template for a standard (non-framework related) python project. The point of this repo is to have a basic project layout with working CI/CD and integrated common python tools. It should be later on adjusted according to the needs of specific project.
- uv (python project manager)
- ruff (formatter)
- ruff (linter)
- ty (type checker)
- bandit (security checks)
- pytest (unit tests)
- pydantic (data validation, models)
- pydantic-settings (settings management)
- prek (git hooks, running checks)
- just (command runner* - easily run tests/checks/application) - optional
* to enable autocompletion of declared commands follow the docs. For Ubuntu with bash do the following:
sudo apt install bash-completion
mkdir -p ~/.local/share/bash-completion/completions
just --completions bash > ~/.local/share/bash-completion/completions/just- uv - python project manager (required)
Install uv
curl -LsSf https://astral.sh/uv/install.sh | shVerify uv installation
uv --versionAfter the uv installation you can init the setup
uv sync
uv run just initor simply just init if you have just installed.
To setup the project manually check the following:
Copy example env file
cp -n .env.example .envCreate new venv and sync packages (base + dev)
uv syncActivate venv
. ./.venv/bin/activateprek configuration is enabled for this project. To run the hooks every time you commit, install prek’s git hook integration:
prek installOn every commit code should be static tested/checked/formatted automatically (using pre-commit tool).
You can run static checks using
just checkTo run unit tests use
just testBuild image
docker build . --tag pyplate-imageCreate container and run it
docker run pyplate-imageYou can also use provided docker-compose
docker compose build
docker compose up