-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
154 lines (133 loc) · 3.59 KB
/
pyproject.toml
File metadata and controls
154 lines (133 loc) · 3.59 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
[build-system]
requires = ["setuptools>=69", "wheel"]
build-backend = "setuptools.build_meta"
[tool.uv]
package = true
[project]
name = "your-cli"
version = "1.2.0"
description = "Simple Python project template with Ruff, Pyright, and Pytest configured."
readme = "README.md"
requires-python = ">=3.12"
license = { text = "MIT" }
authors = [
{ name = "changeme", email = "changeme@local.local" }
]
dependencies = [
"click>=8.1.7",
"PyYAML>=6.0",
"numpy>=1.26.0",
"pandas>=2.0.0",
"openai>=2.17.0",
"python-dotenv>=1.0.0"
]
[project.scripts]
your-cli = "your_cli.main:main"
[project.optional-dependencies]
dev = [
"bandit>=1.9.3",
"bump>=1.3.0",
"pip-audit>=2.0",
"pyright>=1.1.380",
"pytest>=8.0",
"pytest-cov>=5.0",
"ruff>=0.4.0",
"pyyaml>=6.0.3"
]
[tool.setuptools]
package-dir = { "" = "src" }
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.package-data]
your_cli = ["commands/**/meta.yaml"]
# ------------------------------------------------------------------------------
# Ruff (lint + format)
# ------------------------------------------------------------------------------
[tool.ruff]
line-length = 120
target-version = "py310"
fix = true
show-fixes = true
src = ["src"]
[tool.ruff.format]
line-ending = "lf"
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
docstring-code-format = true
docstring-code-line-length = 120
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"W", # pycodestyle warnings
"I", # isort
"B", # flake8-bugbear
"UP", # pyupgrade
"SIM", # flake8-simplify
"C4", # flake8-comprehensions
"PL", # pylint (subset, sane)
]
ignore = [
"E203", # whitespace before ':' (Black/Ruff formatter compatible)
"E501", # line length handled by formatter
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["PLR2004"] # magic values OK in tests
# ------------------------------------------------------------------------------
# Pyright (type checking – VS Code / Pylance parity)
# ------------------------------------------------------------------------------
[tool.pyright]
pythonVersion = "3.10"
typeCheckingMode = "standard"
reportMissingTypeStubs = false
reportUnknownMemberType = false
reportUnknownVariableType = false
reportUnknownArgumentType = false
reportPrivateImportUsage = false
include = ["src"]
exclude = [
"**/__pycache__",
".venv",
"build",
"dist",
]
# ------------------------------------------------------------------------------
# Pytest
# ------------------------------------------------------------------------------
[tool.pytest.ini_options]
minversion = "8.0"
addopts = "-ra -q"
testpaths = ["tests"]
# ------------------------------------------------------------------------------
# Coverage (optional but common)
# ------------------------------------------------------------------------------
[tool.coverage.run]
branch = true
source = ["src"]
[tool.coverage.report]
show_missing = true
skip_covered = true
# ------------------------------------------------------------------------------
# Bandit vulnerability scanner
# ------------------------------------------------------------------------------
[tool.bandit]
# Paths to exclude (glob patterns)
exclude_dirs = [
".venv",
"venv",
"__pycache__",
"build",
"dist",
".git"
]
# Specific test IDs to skip
# skips = [
# "B101", # assert_used
# "B601", # paramiko_calls
# "B404" # import_subprocess
# ]
# Only run specific tests (optional - omit to run all)
# tests = ["B201", "B301", "B302"]
# Exclude specific files (glob patterns)
# exclude = ["*/test_*.py", "*/conftest.py"]