forked from CTSRD-CHERI/cheribuild
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
134 lines (119 loc) · 3.59 KB
/
Copy pathpyproject.toml
File metadata and controls
134 lines (119 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
[project]
name = "cheribuild"
version = "0.99.0"
requires-python = ">=3.8"
dependencies = [] # Should work without any packages installed.
[project.optional-dependencies]
extras = [
"argcomplete>=3.6.3",
"libtmux>=0.38.1",
"pyserial>=3.5",
# libtmux 0.40+ uses typing_extensions
"typing-extensions>=4.12.2",
]
[tool.ruff]
# Ensure suggested fixes are compatible with our minimum supported version
target-version = "py38"
line-length = 120
src = ["pycheribuild", "release-scripts", "test-scripts", "tests"]
exclude = [
".git",
".idea",
".run",
".pytype/",
".venv",
"3rdparty",
"venv",
]
output-format = "full"
show-fixes = true
[tool.ruff.lint]
select = ["E", "F", "I", "N", "W", "U", "COM", "RUF", "PLC", "PLE", "PLW"]
ignore = [
"UP037", # Remove quotes from type annotation, not possible until we start using 3.7 as the minimum
"PLW2901", # `for` loop variable `value` overwritten by assignment target
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` (cannot be fixed due to bug)
"COM812", # Incompatible with `ruff format`
"PLC0415", # `import` should be at the top-level of a file
]
[tool.ruff.lint.isort]
relative-imports-order = "closest-to-furthest"
known-local-folder = ["pycheribuild"]
[tool.black]
line-length = 120
target-version = ['py38']
# 'extend-exclude' excludes files or directories in addition to the defaults
# Currently reformatting pycheribuild/ results in lots of weird formatting, so
# let's restrict this to the other files for now.
extend-exclude = '''3rdparty|\.pytype|pycheribuild'''
preview = true
required-version = '23'
[tool.pyrefly]
project-includes = [
"pycheribuild", "test", "test-scripts"
]
search-path = [
".",
"3rdparty/junitparser",
"3rdparty/pexpect",
"3rdparty/ptyprocess",
"test-scripts"
]
python-version = "3.8.0"
python-platform = "linux"
[tool.pyrefly.errors]
# bad-override would cause lots of churn
bad-override = false
# TODO: enable all of these one-by-one
missing-attribute = false
no-access = false
bad-assignment = false
not-callable = false
bad-function-definition = false
not-iterable = false
bad-param-name-override = false
inconsistent-inheritance = false
invalid-inheritance = false
read-only = false
redundant-condition = true
redundant-cast = false
[tool.ty.src]
exclude = ["3rdparty"]
[tool.ty.rules]
invalid-argument-type = "error"
invalid-assignment = "error"
# Too many issues to fix for now
unresolved-attribute = "ignore"
invalid-parameter-default = "ignore"
invalid-method-override = "ignore"
call-top-callable = "ignore"
invalid-super-argument = "ignore"
no-matching-overload = "ignore"
invalid-attribute-access = "ignore"
[tool.ty.environment]
python-platform = "all"
# We use typing.Self which is 3.11. Since it's only used in unevaluated
# contexts pretend 3.11 is the minimum version to avoid unresolved errors
python-version = "3.11"
extra-paths = ["./3rdparty/junitparser", "./3rdparty/pexpect", "./3rdparty/ptyprocess"]
[[tool.ty.overrides]]
include = ["tests/**"]
[tool.ty.overrides.rules]
invalid-argument-type = "ignore" # Weird false positive with pytest.skip/fail
too-many-positional-arguments = "ignore" # Weird false positive with pytest.skip/fail
[dependency-groups]
dev = [
"argcomplete>=3.6.3",
"flake8>=5.0.4",
"libtmux>=0.38.1",
"pre-commit>=3.5.0",
"pyrefly>=0.62.0",
"pyserial>=3.5",
"pytest>=7.0,<9.0",
"ruff>=0.15.11",
"setuptools<82",
"ty>=0.0.26",
]
[tool.uv.dependency-groups]
# TODO: Use a slightly newer minimum version for dev dependencies to allow resolving them.
# dev = {requires-python = ">=3.9"}