membersystem/pyproject.toml

167 lines
4.5 KiB
TOML
Raw Permalink Normal View History

2024-01-13 14:39:31 +00:00
[build-system]
2024-03-03 10:05:08 +00:00
requires = ["hatchling"]
2024-01-13 14:39:31 +00:00
build-backend = "hatchling.build"
[project]
name = "membersystem"
description = ''
readme = "README.md"
requires-python = ">=3.11"
keywords = []
authors = [
{ name = "Víðir Valberg Guðmundsson", email = "valberg@orn.li" },
]
dependencies = [
"Django~=5.1",
"django-allauth~=0.63",
"django-money~=3.5",
"django-oauth-toolkit~=2.4",
2024-01-13 14:39:31 +00:00
"django-registries==0.0.3",
2024-01-14 11:27:36 +00:00
"django-view-decorator==0.0.4",
"django-oauth-toolkit~=2.4",
2024-08-06 21:49:21 +00:00
"django-ratelimit~=4.1",
"django-zen-queries~=2.1",
"django_stubs_ext~=5.0",
"environs[django]>=11,<12",
"psycopg[binary]~=3.2",
"stripe~=10.5",
"uvicorn~=0.30",
"whitenoise~=6.7",
2024-01-13 14:39:31 +00:00
]
2024-03-03 10:05:08 +00:00
version = "0.0.1"
2024-01-13 14:39:31 +00:00
2024-03-03 10:05:08 +00:00
[tool.hatch.build.targets.wheel]
packages = ["src"]
2024-01-13 14:39:31 +00:00
2024-07-14 21:14:07 +00:00
[tool.hatch.env]
requires = ["hatch-pip-compile"]
2024-01-13 14:39:31 +00:00
[tool.hatch.envs.default]
2024-07-14 21:14:07 +00:00
type = "pip-compile"
pip-compile-resolver = "uv"
2024-07-14 21:14:07 +00:00
[tool.hatch.envs.dev]
type = "pip-compile"
pip-compile-resolver = "uv"
2024-01-13 14:39:31 +00:00
dependencies = [
"coverage[toml]==7.3.0",
"pytest==7.2.2",
"pytest-cov",
"pytest-django==4.5.2",
"mypy==1.1.1",
"django-stubs==1.16.0",
"pip-tools==7.3.0",
"django-debug-toolbar==4.2.0",
"django-browser-reload==1.7.0",
"model-bakery==1.17.0",
]
[[tool.hatch.envs.tests.matrix]]
python = ["3.12"]
django = ["5.1"]
2024-01-13 14:39:31 +00:00
[tool.hatch.envs.tests.overrides]
matrix.django.dependencies = [
{ value = "django~={matrix:django}" },
]
[tool.hatch.envs.default.scripts]
2024-01-13 14:39:31 +00:00
cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=src --cov=tests --cov=append {args}"
no-cov = "cov --no-cov {args}"
typecheck = "mypy --config-file=pyproject.toml ."
requirements = "hatch env run --env default -- python --version; hatch env run --env dev -- python --version"
2024-03-03 10:05:08 +00:00
server = "./src/manage.py runserver 0.0.0.0:8000"
2024-01-13 14:39:31 +00:00
migrate = "./src/manage.py migrate"
makemigrations = "./src/manage.py makemigrations"
createsuperuser = "./src/manage.py createsuperuser"
shell = "./src/manage.py shell"
# You need to install Stripe CLI from here to run this: https://github.com/stripe/stripe-cli/releases
stripe_cli = "stripe listen --forward-to 0.0.0.0:8000/order/stripe/webhook/"
2024-01-13 14:39:31 +00:00
[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE="tests.settings"
addopts = "--reuse-db"
norecursedirs = "build dist docs .eggs/* *.egg-info htmlcov .git"
python_files = "test*.py"
testpaths = "tests"
pythonpath = ". tests"
[tool.coverage.run]
branch = true
parallel = true
[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
[tool.mypy]
mypy_path = "src/"
exclude = [
"venv/",
"dist/",
"docs/",
]
namespace_packages = false
show_error_codes = true
strict = true
warn_unreachable = true
follow_imports = "normal"
plugins = ["mypy_django_plugin.main"]
2024-01-13 14:39:31 +00:00
[tool.django-stubs]
django_settings_module = "project.settings"
2024-01-13 14:39:31 +00:00
[[tool.mypy.overrides]]
module = "tests.*"
allow_untyped_defs = true
2024-02-29 20:25:59 +00:00
[tool.ruff]
target-version = "py312"
extend-exclude = [
".git",
"__pycache__",
2024-07-14 22:19:37 +00:00
"manage.py",
"asgi.py",
"wsgi.py",
2024-02-29 20:25:59 +00:00
]
line-length = 120
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"G004", # Logging statement uses f-string
"ANN101", # Missing type annotation for `self` in method
"ANN102", # Missing type annotation for `cls` in classmethod
"EM101", # Exception must not use a string literal, assign to variable first
"EM102", # Exception must not use a f-string literal, assign to variable first
"COM812", # missing-trailing-comma (https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules)
"ISC001", # single-line-implicit-string-concatenation (https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules)
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
2024-07-14 22:19:37 +00:00
"D105", # Missing docstring in magic method
"D106", # Missing docstring in public nested class
"D107", # Missing docstring in `__init__`
2024-07-14 22:19:37 +00:00
"FIX", # TODO, FIXME, XXX
"TD", # TODO, FIXME, XXX
"ANN002", # Missing type annotation for `*args`
"ANN003", # Missing type annotation for `**kwargs`
"FBT001", # Misbehaves: Boolean-typed positional argument in function definition
"FBT002", # Misbehaves: Boolean-typed positional argument in function definition
"TRY003", # Avoid specifying long messages outside the exception class
2024-02-29 20:25:59 +00:00
]
[tool.ruff.lint.isort]
force-single-line = true
2024-07-14 22:19:37 +00:00
[tool.ruff.lint.per-file-ignores]
"tests.py" = [
"S101", # Use of assert
"SLF001", # Private member access
"D100", # Docstrings
"D103", # Docstrings
]