Last active
March 7, 2022 14:58
-
-
Save 0atman/4bbe38ccb2fab92d66d17a081f24e0ac to your computer and use it in GitHub Desktop.
Sensible python defaults in 2022
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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
further reading https://mitelman.engineering/blog/python-best-practice/automating-python-best-practices-for-a-new-project/