-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
117 lines (102 loc) · 3.15 KB
/
pyproject.toml
File metadata and controls
117 lines (102 loc) · 3.15 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
[project]
name = "my_project"
version = "0.0.0"
description = "Python bindings for my_project C++ library"
readme = "README.md"
authors = [{ name = "Your Name", email = "your.email@example.com" }]
requires-python = ">=3.10"
dependencies = []
[build-system]
requires = [
"setuptools>=42",
"wheel",
"cmake>=3.10",
"pybind11>=2.6.0",
"packaging>=24.2",
]
build-backend = "setuptools.build_meta"
[tool.setuptools]
packages = ["my_project"]
[dependency-groups]
dev = [
"mypy>=1.15.0",
"packaging>=24.2",
"pre-commit>=4.1.0",
"pytest>=8.3.5",
"pytest-cov>=6.0.0",
"pytest-xdist>=3.6.1",
"ruff>=0.9.10",
]
setup = ["rich>=13.9.4", "click>=8.1.8", "click-help-colors>=0.9.4"]
[tool.uv]
default-groups = ["dev"]
[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
".git",
".env",
".venv",
".mypy_cache",
".pytest_cache",
".ruff_cache",
"__pycache__",
"build",
"dist",
"3rdparty/*",
]
line-length = 119
indent-width = 4
target-version = "py310"
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "auto"
[tool.ruff.lint]
# Enable all rules that match Google Python Style Guide
select = [
"E", # pycodestyle errors (PEP8)
"F", # pyflakes - Python syntax errors and undefined names
"W", # pycodestyle warnings
"I", # isort - import sorting
"N", # pep8-naming - Google Style Guide naming conventions
"D", # pydocstyle - Google Style docstring conventions
"B", # flake8-bugbear - Additional bug detection
"C4", # flake8-comprehensions - Better list/set/dict comprehensions
"DTZ", # flake8-datetimez - Modern datetime practices
"T20", # flake8-print - Discourage print statements
"RET", # flake8-return - Consistent return statements
"SIM", # flake8-simplify - Code simplification suggestions
"ERA", # eradicate - Remove commented-out code
]
ignore = [
"E501", # line too long (we keep 119 as specified)
"D203", # one-blank-line-before-class (conflicts with D211)
"D213", # multi-line-summary-second-line (conflicts with D212)
"D104", # undocumented-public-package
"RET504", # return statement is redundant (not necessary)
"SIM108", # Use tenary operator instead of if-else block (if else block is more readable)
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # Ignore unused imports in __init__ files
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
[tool.mypy]
ignore_missing_imports = true
[tool.pytest.ini_options]
log_level = "INFO"
addopts = [
"--durations=0", # Show durations of each test
"--strict-markers", # Warn if unregistered markers are used
"--tb=short", # Short traceback format
"-ra", # Show all test results summary (failures, skips, etc.)
"--showlocals", # Show local variables on failure
"-vv", # Show verbose output
"--color=yes",
"-n=4",
]
testpaths = ["tests/python"] # Directory containing test files
python_files = ["test_*.py", "*_test.py"] # Test file patterns
python_classes = ["Test*"]
python_functions = ["test_*"]