forked from balisujohn/localwriter
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpyproject.toml
More file actions
127 lines (108 loc) · 3.24 KB
/
pyproject.toml
File metadata and controls
127 lines (108 loc) · 3.24 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
[project]
name = "WriterAgent"
dynamic = ["version"]
description = "LibreOffice AI writing assistant with MCP server"
requires-python = ">=3.11"
license = {text = "GPL-3.0-or-later"}
dependencies = [
"polib",
"pytest-cov>=7.1.0",
"ty",
"bowler",
]
[tool.uv]
default-groups = ["dev"]
[tool.setuptools.dynamic]
version = {attr = "plugin.version.EXTENSION_VERSION"}
[tool.setuptools.packages.find]
include = ["plugin*"]
[tool.pytest.ini_options]
testpaths = ["plugin/tests"]
addopts = "--ignore=plugin/tests/uno"
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[dependency-groups]
dev = [
"latex2mathml",
"pytest",
"pyyaml",
"sounddevice",
"dspy",
"mypy",
"types-requests",
"types-unopy",
"pyright>=1.1.408",
"bandit[toml]>=1.8.0",
"ruff>=0.9.0",
"pyrefly>=0.61.0",
]
[tool.ruff]
line-length = 120
extend-exclude = [
"plugin/contrib",
"plugin/lib",
"plugin/tests",
]
[tool.ruff.lint]
extend-select = ["TC"]
# UNO/bootstrap often uses imports after path setup; one-line if/for with colon is legacy style.
extend-ignore = ["E402", "E701"]
[tool.ruff.lint.flake8-type-checking]
quote-annotations = true
# Dataclass field types are evaluated at class creation; keep first-party imports out of TYPE_CHECKING.
runtime-evaluated-decorators = ["dataclasses.dataclass"]
[tool.mypy]
python_version = "3.11"
explicit_package_bases = true
disable_error_code = ["annotation-unchecked"]
packages = ["plugin"]
exclude = [
"plugin/contrib/",
"plugin/lib/",
"plugin/tests/",
]
[[tool.mypy.overrides]]
module = "officehelper"
ignore_missing_imports = true
# `exclude` does not skip subpackages when using `packages = ["plugin"]`; mirror ty scope.
[[tool.mypy.overrides]]
module = "plugin.contrib.*"
ignore_errors = true
[[tool.mypy.overrides]]
module = "plugin.lib.*"
ignore_errors = true
[[tool.mypy.overrides]]
module = "plugin.tests.*"
ignore_errors = true
[[tool.mypy.overrides]]
module = "sounddevice"
ignore_missing_imports = true
disable_error_code = ["import-untyped"]
[tool.bandit]
# Same scope as ty/mypy/pyright: extension code only (see Makefile `bandit` target).
exclude_dirs = ["plugin/contrib", "plugin/lib", "plugin/tests"]
# urllib is used intentionally for HTTP (see modules/http); B314 is ET on trusted small update.xml.
skips = ["B310", "B314"]
[tool.ty.src]
# Optional: explicitly set what to include (defaults to common patterns)
include = ["plugin"]
exclude = ["plugin/contrib", "plugin/lib", "plugin/tests"]
# Pyrefly (CLI: make pyrefly) — experimental; same scope as ty/mypy/pyright; not part of make test
[tool.pyrefly]
project-includes = ["plugin"]
project-excludes = ["plugin/contrib/**", "plugin/lib/**", "plugin/tests/**"]
python-version = "3.11"
# Repo root so `from plugin...` inside `if TYPE_CHECKING:` resolves; Pyrefly treats TYPE_CHECKING as true.
search-path = ["."]
check-unannotated-defs = true
infer-return-types = "checked"
infer-with-first-use = true
# Pyright (CLI: make pyright) — same scope as ty/mypy; uses .venv for stubs (types-unopy) and UNO via make fix-uno
[tool.pyright]
pythonVersion = "3.11"
venvPath = "."
venv = ".venv"
include = ["plugin"]
exclude = ["plugin/contrib", "plugin/lib", "plugin/tests"]
reportMissingModuleSource = false