A ready-to-use Python project template with:
loggerlogging intologs/directory.envconfiguration loading viapydantic-settingspytesttesting supportpoetrydependency managementruffstatic analysiscommitizen— Conventional Commits validation (pre-commit)release-please— automated version bump,CHANGELOG.md, tags and GitHub Releases via CI
-
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.
Releases are automated by release-please
in CI — you never bump versions, write CHANGELOG.md, or create tags by hand:
- Land well-formed Conventional Commits on
main(the commit types decide the bump:fix:→ patch,feat:→ minor,!/BREAKING CHANGE→ major). release-pleaseopens and maintains a release PR with the version bump inpyproject.toml+ the changelog entry.- Merge that PR — release-please creates the
vX.Y.Ztag and the GitHub Release.
The current released version is seeded in .release-please-manifest.json.
Enable Settings → Actions → General → Workflow permissions → "Read and write permissions" and "Allow GitHub Actions to create and approve pull requests", otherwise the action cannot open the release PR.
Application 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 (lint + tests on PRs).github/workflows/release-please.yml— release automation (runs on push tomain)release-please-config.json— release-please configuration (release-type, changelog).release-please-manifest.json— current released version, owned by release-please.pre-commit-config.yaml— pre-commit configurationCHANGELOG.md— auto-generated changelog (owned by release-please).env.example— example environment settings