Skip to content

agrawalsourav98/python-package-template

Repository files navigation

Python Package Template

Template to create Python Packages.

Development Features

  • 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 and isort
  • Checks using flake8, which can be extended using extensions
  • Ready to use pre-commit hooks with code-formatting.
  • Type checking with mypy; security checks using bandit and safety.
  • Testing setup with pytest
  • Ready to use .editorconfig and .gitignore.

Deployment Features

  • 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 Usage

Makefile contains a lot of functions for faster development.

  1. Normal Install

    To install run,

    make install

    To uninstall,

    make uninstall
  2. Developer Install

    To download and install Poetry run:

    make dev-install

    To uninstall

    make uninstall
  3. Run formatting

    To run formatting (black and isort):

    make format
  4. Running tests

    To run tests:

    make test
  5. Linting

    Liniting runs tests, pre-commit hooks, type checking and safety checking.

    make lint

    To run individually,

    Safety Check, runs bandit and safety

    make check-safety

    Type checking, runs mypy

    make type-checking

    Pre-commit, runs formatters, flake8 and some pre commit hooks

    make pre-commit

Contributing

See CONTRIBUTING.md

TODOS

  • Add docs support
  • Add cookiecutter support
  • Add CI/CD configs

Acknowledgements

This template was inspired by,

About

Template to create Python Packages.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published