Did some things, made more improvements.
Signed-off-by: Cliff Hill <xlorep@darkhelm.org>
This commit is contained in:
@@ -2,6 +2,19 @@
|
||||
build-backend = "hatchling.build"
|
||||
requires = ["hatchling"]
|
||||
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
"ruff>=0.6.0",
|
||||
"pyright>=1.1.380",
|
||||
"darglint>=1.8.1",
|
||||
"pytest>=7.4.0",
|
||||
"pytest-asyncio>=0.21.0",
|
||||
"pytest-cov>=4.1.0",
|
||||
"typeguard>=4.1.0",
|
||||
"httpx>=0.25.0", # For testing async HTTP calls
|
||||
"pytest-mock>=3.12.0"
|
||||
]
|
||||
|
||||
[project]
|
||||
dependencies = [
|
||||
"fastapi>=0.104.0",
|
||||
@@ -21,65 +34,73 @@ dev = [
|
||||
"darglint>=1.8.1",
|
||||
"pytest>=7.4.0",
|
||||
"pytest-asyncio>=0.21.0",
|
||||
"pytest-cov>=4.1.0"
|
||||
"pytest-cov>=4.1.0",
|
||||
"typeguard>=4.1.0",
|
||||
"httpx>=0.25.0", # For testing async HTTP calls
|
||||
"pytest-mock>=3.12.0"
|
||||
]
|
||||
|
||||
[tool.coverage]
|
||||
|
||||
[tool.coverage.report]
|
||||
exclude_lines = [
|
||||
"pragma: no cover",
|
||||
"def __repr__",
|
||||
"raise AssertionError",
|
||||
"raise NotImplementedError",
|
||||
"if __name__ == .__main__.:",
|
||||
"if TYPE_CHECKING:"
|
||||
]
|
||||
|
||||
[tool.coverage.run]
|
||||
omit = [
|
||||
"*/tests/*",
|
||||
"*/venv/*",
|
||||
"*/.venv/*",
|
||||
"*/node_modules/*",
|
||||
"*/migrations/*"
|
||||
]
|
||||
source = ["src"]
|
||||
|
||||
# Darglint configuration for backend
|
||||
[tool.darglint]
|
||||
docstring_style = "google"
|
||||
strictness = "short"
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["src/backend"]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
addopts = [
|
||||
"--strict-markers",
|
||||
"--strict-config",
|
||||
"--verbose",
|
||||
"--cov=backend",
|
||||
"--cov-report=term-missing:skip-covered",
|
||||
"--cov-report=html",
|
||||
"--cov-report=xml",
|
||||
"--typeguard-packages=backend"
|
||||
]
|
||||
markers = [
|
||||
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
|
||||
"integration: marks tests as integration tests"
|
||||
]
|
||||
python_classes = ["Test*"]
|
||||
python_files = ["test_*.py", "*_test.py"]
|
||||
python_functions = ["test_*"]
|
||||
testpaths = ["tests"]
|
||||
|
||||
[tool.ruff]
|
||||
# Exclude common directories
|
||||
exclude = [
|
||||
".bzr",
|
||||
".direnv",
|
||||
".eggs",
|
||||
".git",
|
||||
".git-rewrite",
|
||||
".hg",
|
||||
".ipynb_checkpoints",
|
||||
".mypy_cache",
|
||||
".nox",
|
||||
".pants.d",
|
||||
".pyenv",
|
||||
".pytest_cache",
|
||||
".pytype",
|
||||
".ruff_cache",
|
||||
".svn",
|
||||
".tox",
|
||||
".venv",
|
||||
".vscode",
|
||||
"__pypackages__",
|
||||
"_build",
|
||||
"buck-out",
|
||||
"build",
|
||||
"dist",
|
||||
"node_modules",
|
||||
"site-packages",
|
||||
"venv"
|
||||
]
|
||||
# Set the maximum line length
|
||||
line-length = 88
|
||||
src = ["src"]
|
||||
target-version = "py313"
|
||||
|
||||
[tool.ruff.format]
|
||||
# Like Black, indent with spaces, rather than tabs.
|
||||
indent-style = "space"
|
||||
# Like Black, automatically detect the appropriate line ending.
|
||||
line-ending = "auto"
|
||||
# Like Black, use double quotes for strings.
|
||||
quote-style = "double"
|
||||
# Like Black, respect magic trailing commas.
|
||||
skip-magic-trailing-comma = false
|
||||
|
||||
[tool.ruff.lint]
|
||||
# Allow unused variables when underscore-prefixed.
|
||||
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
|
||||
# Allow fix for all enabled rules (when `--fix`) is provided.
|
||||
fixable = ["ALL"]
|
||||
# Ignore specific rules
|
||||
ignore = [
|
||||
"E501", # line too long (handled by line-length setting)
|
||||
"E501", # line too long, handled by black
|
||||
"B008", # do not perform function calls in argument defaults
|
||||
"RUF012" # mutable class attributes should be annotated with typing.ClassVar
|
||||
"B903" # Use `collections.abc.MutableMapping` instead of `typing.MutableMapping`
|
||||
]
|
||||
# Enable specific rule sets
|
||||
select = [
|
||||
"E", # pycodestyle errors
|
||||
"W", # pycodestyle warnings
|
||||
@@ -90,15 +111,8 @@ select = [
|
||||
"UP", # pyupgrade
|
||||
"ARG", # flake8-unused-arguments
|
||||
"SIM", # flake8-simplify
|
||||
"TCH", # flake8-type-checking
|
||||
"PTH", # flake8-use-pathlib
|
||||
"RUF" # ruff-specific rules
|
||||
"TCH" # flake8-type-checking
|
||||
]
|
||||
unfixable = []
|
||||
|
||||
[tool.ruff.lint.isort]
|
||||
known-first-party = ["app"]
|
||||
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
# Tests can use magic values, assertions, and relative imports
|
||||
"tests/**/*" = ["PLR2004", "S101", "TID252"]
|
||||
"tests/*" = ["ARG", "S101"]
|
||||
|
||||
Reference in New Issue
Block a user