Skip to content

Instantly share code, notes, and snippets.

@niccolomineo
Last active August 9, 2023 10:15
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 niccolomineo/6a16507d41a694b7233e3539a8f6cae6 to your computer and use it in GitHub Desktop.
Save niccolomineo/6a16507d41a694b7233e3539a8f6cae6 to your computer and use it in GitHub Desktop.
A `pyproject.toml` configuration for a Django / Python 3.11 installable package
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools",
"wheel",
]
[project]
name = "Django Project"
version = "0.0.1"
description = "A Django project"
readme = "README.md"
license = { text = "BSD-3-Clause" }
authors = [
{ name = "John Doe", email = "john@doe.com" },
]
requires-python = ">=3.11"
dependencies = [
"Django<4.2,>=4.1",
"django-filter<23.2,>=2.4",
"djangorestframework<3.15,>=3.13",
"djangorestframework-camel-case<1.5,>=1.4",
"djangorestframework-gis<1.1,>=0.18",
]
[project.optional-dependencies]
test = [
"bandit~=1.7",
"black~=23.3",
"coverage[toml]~=7.2",
"mypy~=1.2",
"pip-audit~=2.5",
"ruff~=0.0",
"tblib~=1.7",
]
[project.urls]
homepage = "https://github.com/johndoe/myproject"
[tool.setuptools]
packages = { find = { } }
[tool.black]
target-version = ["py311"]
[tool.coverage.run]
branch = true
concurrency = ["multiprocessing"]
data_file = ".coverages/.coverage"
disable_warnings = ["no-data-collected"]
omit = [
".venv/*",
"*/asgi.py",
"*/wsgi.py",
"manage_local.py",
"manage.py",
"setup.py",
"venv/*",
]
source = ["."]
[tool.mypy]
ignore_missing_imports = true
python_version = "3.11"
exclude = ["build/",]
[tool.ruff]
extend-exclude = [
"__pycache__",
".pytest_cache",
".venv",
".vscode*",
"*/migrations/*",
"*/tests/data/*",
]
extend-ignore = [
"A003",
"D203",
"D212",
"D213",
"D214",
"D215",
"D401",
"D404",
"D405",
"D406",
"D407",
"D408",
"D409",
"D410",
"D411",
"D413",
"D415",
"D416",
"D417",
]
select = ["A", "B", "C", "D", "E", "F", "I", "W", "B9"]
target-version = "py311"
[tool.ruff.per-file-ignores]
"myproject/*sgi.py" = ["E402"]
[tool.ruff.isort]
known-first-party = [
"myproject",
]
known-third-party = [
"django",
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment