forked from postgrespro/pg_probackup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
124 lines (106 loc) · 2.79 KB
/
pyproject.toml
File metadata and controls
124 lines (106 loc) · 2.79 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
[project]
name = "pg_probackup-tests"
version = "0.1.0"
description = "Tests for pg_probackup - PostgreSQL backup and recovery utility"
requires-python = ">=3.8"
readme = "README.md"
dependencies = [
"testgres>=1.12.0",
"deprecation",
"pexpect",
]
[project.optional-dependencies]
test = [
"pytest>=7.4.3",
"pytest-xdist",
"allure-pytest",
]
dev = [
"ruff",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["tests"]
[dependency-groups]
dev = [
"pytest>=7.4.3",
"pytest-xdist",
"pytest-timeout",
"allure-pytest",
"ruff",
]
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["*_test.py"]
python_classes = ["*Test"]
python_functions = ["test_*"]
addopts = "-v"
[tool.ruff]
# Target Python version
target-version = "py38"
# Line length matching Black's default
line-length = 120
# Exclude common directories
exclude = [
".git",
".venv",
"venv",
"__pycache__",
".pytest_cache",
"build",
"dist",
]
[tool.ruff.lint]
# Enable recommended rule sets
select = [
"E", # pycodestyle errors
"F", # Pyflakes (undefined names, unused imports, etc.)
"W", # pycodestyle warnings
"I", # isort (import sorting)
"B", # flake8-bugbear (likely bugs)
"C4", # flake8-comprehensions
"UP", # pyupgrade (modernize syntax)
]
# Ignore rules that are too noisy or not applicable
ignore = [
"E501", # Line too long (handled by line-length setting)
"UP030", # Use implicit references for positional format fields (too many changes)
"UP031", # Use format specifiers instead of percent format
"UP032", # Use f-string instead of format call (too many changes, can enable later)
]
# Allow autofix for all enabled rules
fixable = ["ALL"]
unfixable = []
[tool.ruff.lint.per-file-ignores]
# Tests can use assert statements and have longer lines
"tests/*.py" = [
"S101", # Use of assert detected
"S311", # Standard pseudo-random generators not suitable for cryptographic purposes
"S603", # subprocess call without shell=True
"S607", # Starting a process with a partial executable path
"S608", # Possible SQL injection (tests use parameterized queries intentionally)
"B018", # Found useless expression (often used in tests for side effects)
]
"tests/helpers/*.py" = [
"S101",
"S311",
"S603",
"S607",
"S608",
]
[tool.ruff.lint.isort]
# isort configuration
known-first-party = ["tests", "helpers"]
force-single-line = false
lines-after-imports = 2
[tool.ruff.format]
# Use double quotes for strings
quote-style = "double"
# Indent with spaces
indent-style = "space"
# Respect magic trailing commas
skip-magic-trailing-comma = false
# Auto-detect line endings
line-ending = "auto"