-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
127 lines (117 loc) · 3.81 KB
/
pyproject.toml
File metadata and controls
127 lines (117 loc) · 3.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
[project]
name = "fact-inventory"
version = "0.0.1"
license = "AGPL-3.0-or-later"
license-files = ["LICENSE"]
description = "Store facts about a system in a database"
readme = "docs/README.md"
requires-python = ">=3.12"
dependencies = [
"gunicorn[gevent]>=26.0.0",
"litestar[annotated-types,standard,sqlalchemy,prometheus,pydantic,opentelemetry]>=2.21.1",
"opentelemetry-sdk>=1.42.1",
"pydantic-settings>=2.13.1",
"sqlalchemy[aiosqlite,postgresql-asyncpg]>=2.0.49",
"structlog>=25.5.0",
]
[dependency-groups]
dev = [
"mypy>=1.20.0",
"pre-commit>=4.5.1",
"pyright>=1.1.409",
"pytest>=9.0.2",
"pytest-asyncio>=1.3.0",
"pytest-xdist>=3.8.0",
"pytest-cov>=6.0.0",
"ruff>=0.15.9",
]
[tool.alembic]
script_location = "migrations"
prepend_sys_path = ["."]
path_separator = "os"
[tool.mypy]
plugins = ["pydantic.mypy"]
disable_bytearray_promotion = true
disable_memoryview_promotion = true
files = "fact_inventory"
ignore_missing_imports = true
show_error_codes = true
strict = true
warn_unused_ignores = true
[tool.pyright]
include = ["fact_inventory"]
venvPath = "."
venv = ".venv"
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
testpaths = ["tests"]
addopts = "--strict --cov=fact_inventory -n auto"
filterwarnings = [
"ignore::DeprecationWarning:advanced_alchemy",
]
[tool.coverage.run]
source = ["fact_inventory"]
branch = true
omit = ["fact_inventory/__main__.py"]
[tool.coverage.report]
show_missing = true
skip_empty = true
exclude_lines = [
"if __name__ == .__main__.:",
"pragma: no cover",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"@abstractmethod",
]
[tool.ruff]
fix = true
[tool.ruff.lint]
extend-select = [
"A", # detect shadowed builtins
"ARG", # unused-arguments
"ASYNC", # async
"B", # flake8-bugbear
"C4", # Catch incorrect use of comprehensions, dict, list, etc
"COM", # enforce trailing comma rules
"DTZ", # require strict timezone manipulation with datetime
"E", # PyCodeStyle errors
"F", # Pyflakes rules
"FA", # Verifies files use from __future__ import annotations if a type is used in the module that can be rewritten using PEP 563.
"FBT", # detect boolean traps
"G", # Better usage of built-in logging
"I", # isort - Import sorting
"ICN", # Use common import conventions
"ISC", # Good use of string concatenation
"LOG", # Checks for issues using the standard library logging module.
"N", # enforce naming conventions, e.g. ClassName vs function_name
"PL", # pylint
"PTH", # Use pathlib instead of os.path
"PYI", # Linting rules for type annotations.
"Q", # Linting rules for quotes
"RET", # Good return practices
"RUF", # Ruff specific lint rules
"S", # bandit
"SIM", # flake8-simplify
"TC", # Enforce importing certain types in a TYPE_CHECKING block
"TCH", # Move type only imports to type-checking condition.
"TID", # Helps you write tidier imports.
"TRY", # tryceratops - track exception handling
"UP", # pyupgrade - Warn if certain things can changed due to newer Python versions
"W" # PyCodeStyle warnings
]
ignore = [
"COM812", # de-dupe trailing commas
"SIM108", # ternary is ugly
"S110", # try-except-pass - silent exception handling is intentional in background jobs
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"ARG001", # fixture args used for side-effects only (e.g. patching) are intentionally unused
"ARG002", # same as ARG001 for method arguments in test classes
"E501", # line too long -- test readability trumps line length
"S101", # test cases use assert
"PLR2004", # magic values -- expected counts are intentional literals in tests
"PLC0415", # imports not at top level -- fixture-scoped imports are intentional
"TRY003", # exception messages in tests are often local
]