Opinionated cookiecutter template for creating a new Python program, or FastAPI application.
Use this template on your own machine with cookiecutter, or create a brand new repository based on this template entirely through the GitHub web interface using either:
You'll need to have cookiecutter, poetry and pre-commit installed.
Run cookiecutter gh:bocdaz/template-python-project
and then answer the prompts.
poetry shell
devspace use context
to select the proper cluster.devspace use namespace my-namespace
to select the namespace to use.devspace dev
.nox
to run ALL linter, security checks, and tests
nox --list-sessions
to list all possible sessionsnox -rs lint
to run the linternox -rs safety
to run security checksnox -rs tests
to run test suitesnox -rs black
to run the formatterpoetry shell
poetry run ___.py
poetry add ___
Feel free to file an issue, including as much relevant info and screenshots if that helps explain things. Then, the community will be able to diagnose your issue and help resolve it.
We're always open to improvements, no matter how small! To suggest a change to this project template, open an issue and the community will be able to discuss whether to include the tool, and if so, how. If you have a suggestion on how to incorporate the tool as well, feel free to create a PR with the change, and reference it in your issue. That would make it even easier for the community to consider the change.
Definitely not! This repo came about from a desire to have a simple way to setup the tools our team uses for python development. But you're absolutely free to configure the tools to work on your project without using this repository as a starting point.
Name | Purpose |
---|---|
coverage.py | Coverage.py is a tool for measuring code coverage of Python programs. |
flake8 | Flake8 is a wrapper around various linting tools, and provides a plggable interface. |
flake8-bandit | Bandit is a tool designed to find common security issues in Python code. |
flake8-black | This is an MIT licensed flake8 plugin for validating Python code style with the command line code formatting tool black. |
flake8-bugbear | A plugin for Flake8 finding likely bugs and design problems in your program. |
flake8-comprehensions | A flake8 plugin that helps you write better list/set/dict comprehensions. |
flake8-docstrings | A simple module that adds an extension for the fantastic pydocstyle tool to flake8. |
isort | isort is a Python utility / library to sort imports alphabetically, and automatically separated into sections and by type. |
nox | nox is a command-line tool that automates testing in multiple Python environments, similar to tox. |
mkdocs-material | MkDocs is a fast, simple and downright gorgeous static site generator that's geared towards building project documentation. Documentation source files are written in Markdown, and configured with a single YAML configuration file. |
pep8-naming | Check your code against PEP 8 naming conventions. This module provides a plugin for flake8, the Python code checker. |
poetry | Poetry helps you declare, manage and install dependencies of Python projects, ensuring you have the right stack everywhere. |
pre-commit | A framework for managing and maintaining multi-language pre-commit hooks. |
pytest | The pytest framework makes it easy to write small tests, yet scales to support complex functional testing for applications and libraries. |
pytest-cov | This pytest plugin produces test coverage reports. |
pytest-mock | This pytest plugin provides a mocker fixture which is a thin-wrapper around the patching API provided by the mock package. |
rope | Rope is a python refactoring library. |
safety | Safety checks your dependencies for known security vulnerabilities. |
xdoctest | The xdoctest package is a re-write of Python's builtin doctest module. |