Skip to content

Instantly share code, notes, and snippets.

@adamghill
Last active December 18, 2022 21:43
Show Gist options
  • Save adamghill/85d8a09eecdf96a5423e715848e7c76a to your computer and use it in GitHub Desktop.
Save adamghill/85d8a09eecdf96a5423e715848e7c76a to your computer and use it in GitHub Desktop.
Default pyproject.toml for Django projects
[tool.poetry]
name = ""
version = "0.1.0"
description = ""
authors = [""]
[tool.poetry.dependencies]
python = "^3.9"
Django = ">3"
django-fbv = "<1"
django-cache-memoize = "^0.1"
httpx = "^0.18"
django-model-utils = "^4"
python-dotenv = "^0.17"
psycopg2-binary = "^2.8"
django-debug-toolbar = "^3.2"
django-compressor = "^2.4"
django-libsass = "^0.8"
whitenoise = "^5.2"
dj-database-url = "^0.5"
django-redis = "^4.12"
sentry-sdk = "^1"
first = "^2"
[tool.poetry.dev-dependencies]
pytest = "^6"
pytest-django = "^4"
poethepoet = "^0"
black = "^22"
isort = "^5"
ruff = "^0"
pywatchman = "^1"
mypy = "^0.930"
coverage = {extras = ["toml"], version = "^6.2"}
pytest-cov = "^3.0.0"
[tool.black]
line-length = 88
[tool.isort]
profile = "black"
multi_line_output = 3
[tool.pytest.ini_options]
addopts = "--quiet --failed-first --reuse-db --nomigrations -p no:warnings"
testpaths = [
"tests"
]
markers = [
"integration: marks tests as integration",
]
[tool.ruff]
line-length = 88
select = ["E", "F"]
ignore = []
extend-select = ["D"]
extend-ignore = [
"D101",
"D102",
"D103",
"D105",
"D106",
"D202",
"D203",
"D204",
"D213",
"D215",
"D400",
"D404",
"D406",
"D407",
"D408",
"D409",
"D413",
"D100",
]
[tool.coverage.run]
branch = true
parallel = true
[tool.coverage.report]
show_missing = true
skip_covered = true
skip_empty = true
[tool.poe.tasks]
r = { cmd = "./manage.py runserver 0:8000", help = "Start dev server" }
mm = { cmd = "./manage.py makemigrations", help = "Make migrations" }
mi = { cmd = "./manage.py migrate", help = "Migrate the database" }
md = ["mm", "mi"]
m = { cmd = "./manage.py", help = "manage.py" }
t = { cmd = "pytest", help = "Run tests" }
tc = { cmd = "pytest --cov=project", help = "Run tests with coverage" }
c = { cmd = "coverage report", help = "Show coverage report" }
my = { cmd = "mypy .", help = "Run mypy" }
b = { cmd = "black . --check --quiet", help = "Run black" }
i = { cmd = "isort . --check --quiet", help = "Run isort" }
tm = ["b", "i", "t", "my"]
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment