Template to create Python Packages.
- Github repo: https://github.com/agrawalsourav98/python-package-template
- Free Software: BSD License
- Supports
Python 3.9
and higher - PIP as dependencies manager. See configuration in
setup.py
. Supports easy versioning similar to poetry. - Automatic codestyle using
black
andisort
- Checks using
flake8
, which can be extended using extensions - Ready to use
pre-commit
hooks with code-formatting. - Type checking with
mypy
; security checks usingbandit
andsafety
. - Testing setup with
pytest
- Ready to use
.editorconfig
and.gitignore
.
- Everything is already set up for security checks, codestyle checks, code formatting, testing, linting, docker builds, etc with Makefile. More details in makefile-usage.
- Dockerfile for your package
Makefile contains a lot of functions for faster development.
-
Normal Install
To install run,
make install
To uninstall,
make uninstall
-
Developer Install
To download and install Poetry run:
make dev-install
To uninstall
make uninstall
-
Run formatting
To run formatting (black and isort):
make format
-
Running tests
To run tests:
make test
-
Linting
Liniting runs tests, pre-commit hooks, type checking and safety checking.
make lint
To run individually,
Safety Check, runs
bandit
andsafety
make check-safety
Type checking, runs
mypy
make type-checking
Pre-commit, runs formatters, flake8 and some pre commit hooks
make pre-commit
See CONTRIBUTING.md
- Add docs support
- Add cookiecutter support
- Add CI/CD configs
This template was inspired by,