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.
/src
/test
main.py
andtest_main
.py to get you started.gitignore
file- venv
- pycache
- coverage
.flake8
configuration for flake8requirements.in
with basic essential dependenciesrequirements.txt
with dependency control
Makefile
configured with:
create-environment
- Set up of Python virtual environmentrequirements
- Installs dependencies and sets up version control and linked dependency
These commands install the below packages that are for the following:
bandit
- Examines code for security flawssafety
- Examines packages for vulnerabilitiesblack
- Python formattercoverage
- Evaluates percentage of tested codeflake8
- Checks code against PEP8 Compliancedev-setup
-
These commands runs the above packages:
security-test
- Run Bandit & Safetyrun-black
- Run Blackrun-flake8
- Run flake8check-coverage
- Runs coverage and generates reportrun-all-checks
- Run all of the above
unit-test
- Run pytest with verbose in venvunit-test-print
- Run pytest and show prints with passing testsunit-testdox
- Run pytest with above and testdoxunit-testdox-single
- Run pytest with all of the above but specify a filepath to execute a single file only
- 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
- Please remember to run make commands to run any tests or to install dependencies as your venv is not activated by default