Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sourcery-ai/python-best-practices-cookiecutter
Python best practices project cookiecutter 🍪
https://github.com/sourcery-ai/python-best-practices-cookiecutter
best-practices black cookiecutter cookiecutter-template flake8 isort mypy pipenv pre-commit pytest python python-best-practices
Last synced: 3 days ago
JSON representation
Python best practices project cookiecutter 🍪
- Host: GitHub
- URL: https://github.com/sourcery-ai/python-best-practices-cookiecutter
- Owner: sourcery-ai
- License: mit
- Created: 2019-07-29T15:02:31.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T18:00:06.000Z (11 months ago)
- Last Synced: 2024-10-29T22:56:45.714Z (15 days ago)
- Topics: best-practices, black, cookiecutter, cookiecutter-template, flake8, isort, mypy, pipenv, pre-commit, pytest, python, python-best-practices
- Language: Python
- Homepage: https://sourcery.ai/blog/python-best-practices/
- Size: 15.6 KB
- Stars: 669
- Watchers: 9
- Forks: 124
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - sourcery-ai/python-best-practices-cookiecutter - Python best practices project cookiecutter 🍪 (Python)
README
# Python Best Practices Cookiecutter
Best practices [cookiecutter](https://github.com/audreyr/cookiecutter) template as described in this [blogpost](https://sourcery.ai/blog/python-best-practices/).
## Features
- Testing with [pytest](https://docs.pytest.org/en/latest/)
- Formatting with [black](https://github.com/psf/black)
- Import sorting with [isort](https://github.com/timothycrosley/isort)
- Static typing with [mypy](http://mypy-lang.org/)
- Linting with [flake8](http://flake8.pycqa.org/en/latest/)
- Git hooks that run all the above with [pre-commit](https://pre-commit.com/)
- Deployment ready with [Docker](https://docker.com/)
- Continuous Integration with [GitHub Actions](https://github.com/features/actions)## Quickstart
```sh
# Install pipx if pipenv and cookiecutter are not installed
python3 -m pip install pipx
python3 -m pipx ensurepath# Install pipenv using pipx
pipx install pipenv# Use cookiecutter to create project from this template
pipx run cookiecutter gh:sourcery-ai/python-best-practices-cookiecutter# Enter project directory
cd# Initialise git repo
git init# Install dependencies
pipenv install --dev# Setup pre-commit and pre-push hooks
pipenv run pre-commit install -t pre-commit
pipenv run pre-commit install -t pre-push
```