-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
182 lines (157 loc) · 4.6 KB
/
pyproject.toml
File metadata and controls
182 lines (157 loc) · 4.6 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
[build-system]
requires = ["setuptools>=68.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "your-project-name" # CHANGE THIS
version = "0.1.0"
description = "Your project description" # CHANGE THIS
readme = "README.md"
requires-python = ">=3.11"
authors = [
{name = "Your Name", email = "your.email@example.com"}, # CHANGE THIS
]
license = {text = "MIT"}
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
[project.urls]
"Homepage" = "https://github.com/yourusername/your-project" # CHANGE THIS
"Bug Tracker" = "https://github.com/yourusername/your-project/issues" # CHANGE THIS
# ============================================================================
# RUFF CONFIGURATION - Fast, comprehensive Python linting
# Replaces: black, isort, flake8, autoflake, pyupgrade, bandit
# ============================================================================
[tool.ruff]
line-length = 120
target-version = "py311"
extend-exclude = [
".eggs",
".git",
".mypy_cache",
".tox",
".venv",
"venv",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
]
[tool.ruff.lint]
select = [
# Core quality checks
"E4", # Import errors
"E7", # Statement errors
"E9", # Runtime errors
"W", # Warnings
"F", # Pyflakes
"I", # isort
"UP", # pyupgrade
"B", # flake8-bugbear
# Code quality
"SIM", # flake8-simplify
"RUF", # Ruff-specific rules
"PIE", # flake8-pie
# Security (selective)
"S102", "S103", "S105", "S106", "S107", "S108",
"S301", "S302", "S303", "S324", "S501", "S506",
# Performance
"PERF",
# Path handling
"PTH",
# Complexity
"C90",
]
ignore = [
"E501", # Line too long (handled by formatter)
"S101", # Assert usage (OK in tests)
"PTH123", # open() -> Path.open() (gradual migration)
]
# Auto-fixing (safe fixes only)
fixable = [
"F401", # Unused imports
"I", # Import sorting
"UP", # Python upgrade suggestions
"W291", "W292", "W293", # Whitespace
"E231", "E201", "E202", # Whitespace in brackets
]
[tool.ruff.lint.isort]
force-single-line = false
force-sort-within-sections = true
known-first-party = ["your_package"] # CHANGE THIS
combine-as-imports = true
[tool.ruff.lint.mccabe]
max-complexity = 15
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
# ============================================================================
# MYPY CONFIGURATION - Type checking
# ============================================================================
[tool.mypy]
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false # Start permissive, tighten over time
check_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
ignore_missing_imports = true
# ============================================================================
# PYTEST CONFIGURATION - Testing
# ============================================================================
[tool.pytest.ini_options]
minversion = "7.0"
addopts = [
"--strict-markers",
"--strict-config",
"--verbose",
"--tb=short",
]
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"unit: marks tests as unit tests",
]
# ============================================================================
# COVERAGE CONFIGURATION
# ============================================================================
[tool.coverage.run]
source = ["src"]
omit = [
"*/tests/*",
"*/test_*",
"*/__pycache__/*",
"*/venv/*",
"*/build/*",
"*/dist/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if __name__ == .__main__.:",
"raise AssertionError",
"raise NotImplementedError",
]
# ============================================================================
# SETUPTOOLS CONFIGURATION
# ============================================================================
[tool.setuptools.packages.find]
where = ["src"]
include = ["your_package*"] # CHANGE THIS
exclude = ["tests*"]