Skip to content
/ python-project Public template

Template for python project structure (with annotations)

License

Notifications You must be signed in to change notification settings

abhabongse/python-project

Repository files navigation

Python Project Template

Template for python project structure (with annotations).

Features

Local Development Setup

1. Poetry

Install Poetry to manage python virtual environments and package dependencies. More information can be read from Poetry documentation.

2. Base Python

If the required version of Python is not installed on the local development machine, we recommend using pyenv to manage multiple installations of Python on the machine.

First, following these instructions to install pyenv. For Linux distributions, we recommend the automatic installer options. Make sure to follow the instructions closely and add pyenv bin directories to $PATH.

Once installed, we can install the desired version of Python (we assume version 3.12.0 here):

$ pyenv install 3.12.0
  • If pyenv command is not present, perhaps restart the terminal or machine first.
  • If there are other problems while installing, consult the troubleshooting page.

3. Setup virtual environments

Use Poetry to create virtual environments and install dependencies:

$ poetry install --with dev

4. Just

Install Just to be able to run project-specific commands. Once installed, you can see the list of commands by running:

$ just

Also, do not forget to run post-installation scripts:

$ just post-install

Git Commit Checklist

Before committing changes in Git Repository, please run through the following checklist:

  1. Run just check to test for code quality (such as ruff code lint, mypy type checking, pytest unit tests, etc.) Fix any complaints until there is no error message.
  2. Run just format to format the code with ruff code formatter.
  3. Run git status to see the status of file changes. Verify with your eye that it is what is expected.

About

Template for python project structure (with annotations)

Resources

License

Stars

Watchers

Forks