-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
133 lines (120 loc) · 3.66 KB
/
pyproject.toml
File metadata and controls
133 lines (120 loc) · 3.66 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
128
129
130
131
132
133
[tool.poetry]
name = "postgres-messaging"
version = "0.0.1"
description = "A simple, typed Python messaging library using PostgreSQL"
authors = ["Eduardo Silvi <eduardo3q@gmail.com>"]
readme = "README.md"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Libraries",
"Typing :: Typed",
]
packages = [{include = "postgres_messaging"}]
[tool.poetry.dependencies]
python = "^3.14"
asyncpg = "^0.31.0"
[tool.poetry.group.dev.dependencies]
pytest = "^8.3.0"
pytest-asyncio = "^1.3.0"
pytest-cov = "^6.0.0"
mypy = "^1.14.0"
ruff = "^0.14.1"
pre-commit = "^4.0.0"
[tool.poetry.requires-plugins]
poetry-pre-commit-plugin = "*"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.mypy]
python_version = "3.14"
strict = true
warn_return_any = true
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
disallow_untyped_defs = true
disallow_any_unimported = false
no_implicit_optional = true
check_untyped_defs = true
show_error_codes = true
show_column_numbers = true
pretty = true
# Per-module options
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
[[tool.mypy.overrides]]
module = "asyncpg.*"
ignore_missing_imports = true
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
[tool.ruff]
line-length = 100
target-version = "py314"
fix = true
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort (import sorting)
"N", # pep8-naming
"UP", # pyupgrade (modernize code)
"ASYNC", # async-specific checks
"S", # bandit security checks
"B", # bugbear (common bugs)
"A", # builtins shadowing
"C4", # comprehensions
"DTZ", # datetime timezone
"T10", # debugger
"ISC", # implicit string concat
"ICN", # import conventions
"PIE", # misc lints
"PT", # pytest style
"Q", # quotes
"RSE", # raise
"RET", # return
"SIM", # simplify
"TID", # tidy imports
"TCH", # type-checking imports
"ARG", # unused arguments
"PTH", # pathlib instead of os.path
"PL", # pylint rules
"RUF", # Ruff-specific rules
]
ignore = [
"S608", # False positive: we use parameterized queries ($1, $2, etc)
"ARG005", # Allow unused lambda arguments (e.g., lambda *args: None for LISTEN/NOTIFY)
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
"S101", # Allow assert
"S105", # Allow hardcoded passwords in tests
"S106", # Allow hardcoded passwords in tests
"S110", # Allow try-except-pass
"ARG", # Allow unused arguments
"PLR2004", # Allow magic values
"PLR0913", # Allow many arguments
"PT011", # Allow broad pytest.raises
"B017", # Allow broad pytest.raises(Exception)
"DTZ005", # Allow datetime.now() without tz in tests
"PLC0415", # Allow imports not at top level
"N806", # Allow non-lowercase variables (MockBroker, etc)
"TC003", # Allow runtime imports in tests (AsyncGenerator)
"PT012", # Allow complex statements in pytest.raises in tests (for transaction tests)
]
"example*.py" = [
"S106", # Allow hardcoded passwords in examples
"S311", # Allow random for examples
"PLR2004", # Allow magic values in examples
"PLC0415", # Allow imports not at top level
"T201", # Allow print in examples
]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "auto"