Skip to content

daddy-shark/python-project-template

 
 

Repository files navigation

Python project template

No matter what kind of project you plan to do (Django/Flask web app or pure-python CLI tool) the Python project template brings you the best practices in code style, code quality, and automation.
Enjoy the development of your new project 🏖️

Features

  • Automated with make development environment:
    • Creating virtualenv
    • Installing requirements
    • Code-style checking with isort and black
    • Linting with prospector (mypy, pylint, pycodestyle, Pyflakes, Mccabe, Dodgy, Pydocstyle, bandit)
    • Unit testing
    • Coverage checking
    • Docker Compose up/down
    • Running the app
    • Cleaning up workdir
  • GitHub Actions workflow
  • Dockerfile & docker-compose

Pre-requirements

  • It's usually good idea to use pyenv
  • Poetry version 1.2.0 or higher

Usage

  • Use the repo as a GitHub template OR:
    • Clone the repo.
    • Change git origin to your new git repo.
  • Run make for the help message.

For example make check will do:

  • create virtualenv (if it doesn't created yet)
  • install requirements (if it doesn't installed yet)
  • install dev requirements (if it doesn't installed yet)
  • run isort --check --diff
  • run black --check --diff
  • run prospector
  • run mypy
  • run unit tests

GitHub Actions use the same (make check) command to check pull requests

ToDo

  • Pre-commit hook

About

A template for new Python project with a focus on best practices.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 49.8%
  • Makefile 36.2%
  • Python 13.4%
  • Shell 0.6%