Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
168 lines (163 loc) · 4.2 KB
/
Copy pathpyproject.toml
File metadata and controls
168 lines (163 loc) · 4.2 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
# The distribution's build-system/`[project]` config lives in `beetkeeper-core/pyproject.toml` to avoid Pants'
# `python_distribution` metadata injection; see the comment there.
[dependency-groups]
dev = [
"bandit>=1.9.4",
"fastapi[standard]>=0.143.0",
"ipython>=9.3.0",
"mutagen>=1.47.0",
"mypy>=2.3.1",
"pytest>=9.1.1",
"pytest-mock>=3.15.1",
"pytest-socket>=0.8.1",
"pytest-xdist>=3.8.0",
"ruamel-yaml>=0.19.1",
"ruff>=0.16.8",
"tomlkit",
]
[tool.uv]
# Constrains only how uv resolves the shared lockfile, keeping both workspace members' `beets` in lockstep;
# the wheels' actual `beets` deps come from each member's `[project]`.
# When bumping this, the Docker base image must be bumped as well.
constraint-dependencies = [
"beets>=2.14.1",
# Security constraint for preventing ealier `mako` versions with vulnerabilities
"mako>=1.4.2",
# Security constraint for preventing earlier `urllib3` versions with vulnerabilities
"urllib3>=2.8.0",
]
sources.beetkeeper = { workspace = true }
sources.beetkeeper_plugin = { workspace = true }
# Members must be registered here or uv (which only reads this root file) can't see them and `uv lock` fails.
workspace.members = [ "beetkeeper-core", "plugin" ]
[tool.ruff]
target-version = "py314"
line-length = 120
indent-width = 4
src = [ "beetkeeper-core/src", "client/src", "plugin/src" ]
format.skip-magic-trailing-comma = true
format.docstring-code-format = true
lint.select = [ "B", "E", "F", "I", "SIM", "UP" ]
lint.extend-select = [
"ASYNC",
"C416",
"D101",
"D107",
"D209",
"D213",
"D417",
"D419",
"ERA001",
"FAST",
"LOG",
"PIE790",
"PLE1142",
"PLE1700",
"PLW0603",
"PT",
"PYI045",
"PYI055",
"RUF006",
"RUF008",
"RUF009",
"RUF010",
"RUF012",
"RUF015",
"RUF018",
"RUF022",
"RUF024",
"RUF032",
"RUF033",
"RUF049",
"RUF100",
"RUF101",
"RUF200",
"TC",
"TID25",
"TRY002",
"W291",
]
# Ignore rules that conflict with the ruff formatter (https://stackoverflow.com/a/77796620).
lint.ignore = [
"COM812",
"COM819",
"D206",
"D300",
"E111",
"E114",
"E117",
"E203",
"E501",
"PT003",
"PT019",
"PT022",
"Q000",
"Q001",
"Q002",
"Q003",
"TC003",
"W191",
]
lint.exclude = [ "beetkeeper-core/src/tests/**/*.py", "build_scripts/**/*.py" ]
# TC off: runtime-needed type hints like `fastapi.Depends` must not move under TYPE_CHECKING.
lint.per-file-ignores."beetkeeper-core/src/beetkeeper/api/**/*.py" = [ "D101", "TC" ]
# TC off: these are all runtime pydantic models.
lint.per-file-ignores."beetkeeper-core/src/beetkeeper/db/**/*.py" = [ "TC" ]
lint.per-file-ignores."integration_tests/**/*.py" = [ "I" ]
lint.per-file-ignores."plugin/**/*.py" = [ "TID25" ]
lint.flake8-tidy-imports.banned-api.httpx.msg = "Use httpx2 instead."
lint.flake8-tidy-imports.banned-api.requests.msg = "Use httpx2 instead."
lint.flake8-type-checking.exempt-modules = [ "typing", "typing_extensions" ]
lint.flake8-type-checking.runtime-evaluated-base-classes = [
"pydantic.BaseModel",
"sqlalchemy.orm.DeclarativeBase",
"sqlmodel.SQLModel",
]
lint.isort.known-first-party = [
"beetkeeper",
"beetkeeper_api_client",
"beetsplug.beetkeeper_plugin",
]
lint.isort.section-order = [
"future",
"standard-library",
"third-party",
"first-party",
"local-folder",
]
lint.isort.split-on-trailing-comma = false
lint.pycodestyle.ignore-overlong-task-comments = true
lint.pydocstyle.convention = "google"
[tool.bandit]
exclude_dirs = [
".github",
".venv",
"beetkeeper-core/src/tests",
"build_scripts",
"docs",
"integration_tests",
"plugin/src/tests",
]
[tool.mypy]
exclude = [ "build_scripts/", "docs/" ]
namespace_packages = true
explicit_package_bases = true
python_version = "3.14"
plugins = [ "pydantic.mypy" ]
overrides = [
# openapi-generator output (see `client/src/BUILD`): its signatures still type-check callers, but errors
# inside the generated modules aren't ours to fix.
{ module = [ "beetkeeper_api_client", "beetkeeper_api_client.*" ], ignore_errors = true }
]
[tool.pytest]
addopts = [
"--force-short-summary",
"--tb=line",
"-p",
"no:cacheprovider",
"--disable-socket",
"--allow-hosts=testclient",
]
filterwarnings = [ "error:pytest.PytestWarning.*" ]
minversion = "9.1"
strict_markers = true