Skip to content

Instantly share code, notes, and snippets.

@0atman
Last active March 7, 2022 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0atman/4bbe38ccb2fab92d66d17a081f24e0ac to your computer and use it in GitHub Desktop.
Save 0atman/4bbe38ccb2fab92d66d17a081f24e0ac to your computer and use it in GitHub Desktop.
Sensible python defaults in 2022
default: lints run
run:
@poetry run python app.py
watch:
@poetry run watchmedo auto-restart --ignore-directories --patterns="*.py" --ignore-patterns="*#*" --recursive make
lints:
clear
@poetry run black app.py
@poetry run flake8 app.py
@poetry run mypy app.py
setup:
@which poetry || curl -sSL https://install.python-poetry.org | python3 -
@poetry self update --preview
@poetry update
[tool.poetry]
name = "defaults"
version = "0.1.0"
description = ""
authors = ["Tristram Oaten <tris@oat.sh>"]
[tool.poetry.dependencies]
python = "^3.10.2"
mypy = "^0.931"
flask-restful = "^0.3.9"
flake8 = "^4.0.1"
watchdog = "^2.1.6"
PyYAML = "^6.0"
[tool.poetry.dev-dependencies]
pytest = "^5.2"
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment