Skip to content

choncode/python_dev_boilerplate_advanced

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Dev Boilerplate Advanced

This is template repository with various preconfigurations to get you started on a Python project whilst hopefully following good Python guidelines and practice such as PEP8.

** This is an improved and more thorough version of python_dev_boilerplate.

What this includes:

Directories

  • /src
  • /test

Files

  • main.py and test_main.py to get you started
  • .gitignore file
    • venv
    • pycache
    • coverage
  • .flake8 configuration for flake8
  • requirements.in with basic essential dependencies
  • requirements.txt with dependency control

Automation

Makefile configured with:

Setup

  • create-environment - Set up of Python virtual environment
  • requirements - Installs dependencies and sets up version control and linked dependency

Compliance and Security

These commands install the below packages that are for the following:

  • bandit - Examines code for security flaws
  • safety - Examines packages for vulnerabilities
  • black - Python formatter
  • coverage - Evaluates percentage of tested code
  • flake8 - Checks code against PEP8 Compliance
  • dev-setup -

These commands runs the above packages:

  • security-test - Run Bandit & Safety
  • run-black - Run Black
  • run-flake8 - Run flake8
  • check-coverage - Runs coverage and generates report
  • run-all-checks - Run all of the above

Testing Code

  • unit-test - Run pytest with verbose in venv
  • unit-test-print - Run pytest and show prints with passing tests
  • unit-testdox - Run pytest with above and testdox
  • unit-testdox-single - Run pytest with all of the above but specify a filepath to execute a single file only

Setup

  • Fork and clone this repo to your machine
  • Open the repo on VSCode
  • Open a new terminal (preferably bash)
  • Run make create-environment
  • Run make requirements
  • Run make dev-setup
  • Run make unit-testdox

Notes

  • Please remember to run make commands to run any tests or to install dependencies as your venv is not activated by default

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published