Skip to content

This repository is a Python boilerplate to be used as a fast starter point

License

Notifications You must be signed in to change notification settings

securipy/python-boilerplate

 
 

Repository files navigation

Python Boilerplate

  • This repository is meant to be used as a fast starter point.
  • The Python version is the 3.10.
  • The project runs inside Docker using docker-compose.
  • The project has configured a Github Action which runs on every push to the main branch.

Requirements

  • You only need to have Docker installed.

Folder structure

  • There is a tests folder with the tests files.
    • In order to add new tests please follow the pytest recommendations.
  • The production code goes inside the src folder.
  • Inside the scripts folder you can find the git hooks files.

Project commands

The project uses Makefiles to run the most common tasks:

  • help : Shows this help.
  • local-setup: Sets up the local environment (e.g. install git hooks).
  • build: Builds the app.
  • update: Updates the app packages.
  • install package=XXX: Installs the package XXX in the app, ex: make install package=requests.
  • run: Runs the app.
  • check-typing: Runs a static analyzer over the code in order to find issues.
  • check-format: Checks the code format.
  • check-style: Checks the code style.
  • reformat: Formats the code.
  • test: Run all the tests.

Important: Please run the make local-setup command before starting with the code.

In order to create a commit you have to pass the pre-commit phase which runs the check and test commands.

Packages

This project uses Poetry as the package manager.

Testing

  • pytest: Testing runner.
  • pytest-xdist: Pytest plugin to run the tests in parallel.
  • doublex: Powerful test doubles framework for Python.
  • expects: An expressive and extensible TDD/BDD assertion library for Python..
  • doublex-expects: A matchers library for the Expects assertion librar.

Code style

  • mypy: A static type checker.
  • flake8: A tool for style guide enforcement.
  • yapf: A Pyhton formatter.
  • pylint: A static code analyser for Python.

About

This repository is a Python boilerplate to be used as a fast starter point

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Makefile 65.7%
  • Python 16.6%
  • Shell 11.2%
  • Dockerfile 6.5%