-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
104 lines (90 loc) · 3 KB
/
pyproject.toml
File metadata and controls
104 lines (90 loc) · 3 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "loomweave-plugin-python"
version = "1.0.0"
description = "Loomweave Python language plugin — v1.0 release"
readme = "README.md"
requires-python = ">=3.11"
authors = [{ name = "John Morrissey", email = "qacona@gmail.com" }]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"packaging>=24",
"pyright==1.1.409",
"pyyaml>=6.0",
]
[project.optional-dependencies]
dev = [
"pytest>=8.0",
"pytest-cov>=5.0",
"ruff>=0.6",
"mypy>=1.11",
"pre-commit>=3.8",
"pip-audit>=2.9",
"build>=1.2",
"types-PyYAML>=6.0",
]
[project.scripts]
loomweave-plugin-python = "loomweave_plugin_python.__main__:main"
[tool.hatch.build.targets.wheel]
packages = ["src/loomweave_plugin_python"]
[tool.hatch.build.targets.wheel.shared-data]
# Route plugin.toml into <install-prefix>/share/loomweave/plugins/<suffix>/ so
# WP2's L9 install-prefix fallback finds it. The <suffix> is produced by
# `discovery.rs::strip_prefix("loomweave-plugin-")` on the binary name, so for
# loomweave-plugin-python the suffix is "python" — the target directory must
# match that basename exactly.
"plugin.toml" = "share/loomweave/plugins/python/plugin.toml"
[tool.ruff]
target-version = "py311"
line-length = 100
src = ["src", "tests"]
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"D", # pydocstyle relaxed per ADR-023
"COM812", # conflicts with ruff format
"ISC001", # conflicts with ruff format
"CPY", # copyright headers are not our convention
"ANN401", # Any is legitimate for JSON-RPC payload fields (shape is open)
"TRY003", # short composed exception messages are fine
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"S101", # assert is the whole point of tests
"PLR2004", # magic numbers are fine in test expectations
"ANN", # type annotations optional in tests
"INP001", # tests/ is a namespace package
"S108", # hard-coded /tmp paths are test fixtures, not real I/O
"E501", # long assert messages in test failures are fine
]
[tool.ruff.lint.mccabe]
# Dispatch loops naturally exceed the default 10; 15 matches our Rust clippy.toml.
max-complexity = 15
[tool.ruff.lint.pylint]
max-returns = 10
max-branches = 15
[tool.ruff.format]
# defaults: double quotes, space indent, trailing commas where appropriate
[tool.mypy]
python_version = "3.11"
strict = true
warn_unused_configs = true
files = ["src", "tests"]
[[tool.mypy.overrides]]
module = "yaml"
ignore_missing_imports = true
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "--strict-markers --cov=loomweave_plugin_python --cov-report=term-missing --cov-fail-under=85"
pythonpath = ["src"]
markers = [
"pyright: requires pyright-langserver on PATH or in the active virtualenv",
"slow: exercises subprocess or scale behavior that is slower than unit tests",
]