Skip to content

Template for Python projects based on Poetry

License

Notifications You must be signed in to change notification settings

cmu-rss-lab/python-project-template

Repository files navigation

python-project-template

This repository provides a template for Python 3.12 projects based on Poetry.

  • click is used for building command line interfaces
  • loguru is used for structured logging
  • mypy is used for type checking
  • pytest is used for writing tests
  • ruff is used for linting and formatting

The repository also provides a GitHub Actions workflow that automatically builds, lints, type checks, and tests the project on every commit, pull request, and direct invocation of the workflow.

Finally, this repository provides a DevContainer to allow you to get started with development without installing anything to your machine (other than Docker and VSCode). To open this project up inside a DevContainer, bring up the command palette in VSCode (CTRL-Shift-P or Command-Shift-P) and select "rebuild and reopen project in DevContainer".

Usage

To setup the virtual environment and install your project, run:

make install

To run the linter:

make lint

To run the type checker:

make type

To run the test suite:

make test

To lint, type check, and test in a single command, run:

make check