-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
98 lines (86 loc) · 3.04 KB
/
pyproject.toml
File metadata and controls
98 lines (86 loc) · 3.04 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
# This enables: `pip install -e .`
[tool.setuptools]
# map the “root” package directory to src/
package-dir = { "" = "src" }
# turn on automatic package discovery
packages = { find = { where = ["src"], include = ["*"] } }
[build-system]
# NOTE: We should *not* add "wheel" here!
# See: https://www.reddit.com/r/Python/comments/1jwbymm/psa_you_should_remove_wheel_from_your/
requires = ["setuptools ~=77.0"]
build-backend = "setuptools.build_meta"
[project]
name = "example_project"
version = "0.1.0"
description = "A Python project"
authors = [{ name = "Author Name", email = "author@email.tld" }]
readme = "README.md"
requires-python = ">=3.13"
# Core dependencies
dependencies = [
]
[dependency-groups]
dev = [
"pyright==1.1.402",
"pytest>=8.4.1",
"ruff==0.10.0",
]
[tool.pyright]
venvPath = "./"
venv = ".venv"
pythonVersion = "3.13"
extraPaths = ["src"]
reportMissingImports = true
reportMissingModuleSource = "error"
typeCheckingMode = "strict"
# Settings for ruff
[tool.ruff]
line-length = 79
target-version = "py313"
# Include all default rules from the ruff "all" baseline, but we'll fine-tune.
lint.select = [
"E", # PEP8 errors (confirms with PEP8)
"W", # PEP8 warnings (confirms with PEP8)
"I", # isort (sorts imports)
"B", # flake8-bugbear rules (catches mulable by mistake and more)
"A", # flake8-builtins (stop accidental shadowing)
"COM", # flake8-commas (no accidental tuples and more)
"ASYNC", # flake8-async rules (fixes async issues)
"FBT", # flake8-boolean-trap rules (stops the Boolean Trap)
"F", # Pyflakes (fixes common mistakes)
"FAST", # FastAPI rules (fixes FastAPI misusage)
"RUF", # ruff-specific rules (fixes common bugs)
"UP", # pyupgrade (modernises code)
"C90", # mccabe (no overly-complex code)
]
lint.ignore = [
# batched-without-explicit-strict is insane! Shut up!
# You almost never want strict=True on itertools.batched.
"B911",
]
[tool.ruff.lint.mccabe]
# Flag errors (`C901`) whenever the complexity level exceeds 20
# This is 20 possible branches through code in a single function.
# See also: https://ntrs.nasa.gov/api/citations/20205011566/downloads/20205011566.pdf
max-complexity = 20
# ruff isort settings
[tool.ruff.lint.isort]
# Black-compatible isort settings for ruff
combine-as-imports = true
force-wrap-aliases = true
split-on-trailing-comma = true
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]
# You can keep third party libraries grouped together by adding them here.
# known-third-party = []
# pytest configuration
[tool.pytest.ini_options]
minversion = "7.0"
addopts = "--strict-markers --tb=short"
testpaths = ["tests"]
python_files = ["test_*.py"]
markers = [
"slow: mark slow tests",
"integration: mark integration tests",
"allow_network: allow network connections for this test",
"unit: mark unit tests",
]