A ready-to-use Python project template with:
loggerlogging intologs/directory.envconfiguration loading viapydantic-settingspytesttesting supportpoetrydependency managementruffstatic analysiscommitizen— Conventional Commits validation (pre-commit) and version bumpgit-cliff— automatedCHANGELOG.md+ GitHub Release notes
-
Install dependencies:
poetry install
-
Copy
.env.exampleto.envand update values:copy .env.example .env
-
Run the application:
poetry run python main.py
-
Run tests:
poetry run pytest
-
Install and run pre-commit hooks (the
--hook-type commit-msgis required so commitizen validates commit messages):poetry run pre-commit install --hook-type pre-commit --hook-type commit-msg poetry run pre-commit run --all-files
-
Setup self-hosted runner if project private
Полный гайд с диаграммами — docs/WORKFLOW.md.
Commit messages must follow Conventional Commits
(feat:, fix:, docs:, chore:, feat(scope)!: … for breaking, etc.).
The commitizen commit-msg hook rejects non-conforming messages.
To cut a release:
poetry run cz bump # bumps version in pyproject.toml, commits, creates tag
git push --follow-tags # pushing the tag triggers .github/workflows/release.ymlThe release workflow generates Release Notes for the new tag with git-cliff --latest,
publishes a GitHub Release, regenerates the full CHANGELOG.md, and commits it back to main —
so you do not need git-cliff installed locally.
Before the first release, set owner/repo in cliff.toml so PR and author links resolve.
To preview the changelog locally (optional), install git-cliff (scoop install git-cliff
on Windows, cargo install git-cliff, or download from
git-cliff releases) and run:
git-cliff --unreleased # preview pending changes
git-cliff -o CHANGELOG.md # rewrite the full changelogApplication logs are written to logs/app.log and the logs/ directory is ignored by Git.
main.py— entry pointapp/config.py— configuration modelapp/logger.py— logger setuptests/— test suite.github/workflows/python-app.yml— GitHub Actions CI.github/workflows/release.yml— Release workflow (triggered byv*tags).pre-commit-config.yaml— pre-commit configurationcliff.toml— git-cliff (changelog generator) configurationCHANGELOG.md— auto-generated changelog.env.example— example environment settings