/python-template

Template for python project using poetry

Primary LanguageShellApache License 2.0Apache-2.0

python-template

Template for python project using poetry. abc.

This README.md will be overwritten by setup.sh.

test test coverage

Repository initialization

Modify the repository info in setup.sh if necessary:

Value Explanation Default
PROJECT_MANAGER Python project manager. uv or Poetry. "uv"
PY_VER Python version. Multiple versions can be set as comma separated value like "3.10,3.9,3.8". "3.13,3.12,3.11,3.10"
PY_MAIN Main python version used by GitHub Actions. The first version in PY_VER
OS OS on which GitHub Actions job runs. Multiple OS can be set as comma separated value like "ubuntu-latest,macos-latest,windows-latest" "ubuntu-latest"
OS_MAIN Main OS used by GitHub Actions. The first OS in OS
CHECKERS Comma separated linter and formatter list. Any of ruff, black, autoflake, autopep8, isort, flake8, bandit, mypy. "ruff,mypy"
CLI Set yes to create a template for command line interface. "no"
USER User name in pyproject.toml and LICCENSE. git config --get user.name
EMAIL Email address in pyproject.toml. git config --get user.email

Run setup.sh.

The repository features

The repository has following features:

  • Environment management with uv or Poetry.
  • Code check/lint with pre-commit.
    • For Python
    • For shell script
    • For Markdown
    • And other small checks including YAML/JSON/TOML checks.
    • All packages instead of pre-commit-hooks are managed by Poetry (pyproject.toml).
    • Most of options are managed by pyproject.toml.
  • Tests using pytest.
  • Automatic tests with GitHub Actions.
    • Generate coverage results in coverage branch (made for py_main and os_main).
  • Package version check/update with Renovate.
  • .gitignore for Python