-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpyproject.toml
More file actions
116 lines (107 loc) · 5.09 KB
/
Copy pathpyproject.toml
File metadata and controls
116 lines (107 loc) · 5.09 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
[project]
name = "jarvis"
authors = [
{ name = "Aerele", email = "navin@aerele.in"}
]
description = "AI superpowers for Frappe/ERPNext — a permission-aware AI assistant over your ERP"
requires-python = ">=3.10"
readme = "README.md"
dynamic = ["version"]
dependencies = [
# "frappe~=15.0.0" # Installed and managed by bench.
"websocket-client>=1.6,<2",
# PDF -> image rasterization for native LLM vision (jarvis/chat/vision.py).
# Permissive license only: pypdfium2 (Apache/BSD), NOT PyMuPDF (AGPL).
"pypdfium2>=4",
# Browser-accurate CSS/HTML parsing for the dashboard theme-conformance
# validator (jarvis/dashboards/theme_validator.py). A regex over untrusted
# canvas CSS/HTML is bypassable (escapes/entities/nesting); the validator must
# tokenize the way the browser does. tinycss2 + lxml are transitively present,
# but html5lib has no other requirer, so pin all three explicitly for the FC image.
"tinycss2>=1.1",
"html5lib>=1.1",
# HTML sanitizer for document export (jarvis/tools/_export/document/sanitizer.py).
# Declared explicitly: frappe only started shipping nh3 itself in v16, so relying
# on the transitive install breaks every Frappe v15 bench at import time. The
# floor matters: sanitizer.py passes clean_content_tags= on every nh3.clean()
# call, and nh3 < 0.2.5 rejects that kwarg with a TypeError. Mirroring frappe
# v16's own "nh3~=0.3.2" pin keeps the two ranges identical, so they can never
# conflict and a v15 bench resolves the same nh3 a v16 bench gets.
"nh3~=0.3.2",
]
[build-system]
requires = ["flit_core >=3.4,<4"]
build-backend = "flit_core.buildapi"
[tool.flit.module]
name = "jarvis"
# Frappe Cloud / bench compatibility gate: which framework majors this app
# supports. erpnext/hrms are deliberately absent - jarvis runs on frappe-only
# benches (app-gated skills/tools handle the rest).
[tool.bench.frappe-dependencies]
frappe = ">=15.0.0,<17.0.0"
# These dependencies are only installed when developer mode is enabled
[tool.bench.dev-dependencies]
# package_name = "~=1.1.0"
[tool.ruff]
line-length = 110
target-version = "py310"
[tool.ruff.lint]
select = [
"F",
"E",
"W",
"I",
"UP",
"B",
"RUF",
]
ignore = [
"B017", # assertRaises(Exception) - should be more specific
"B018", # useless expression, not assigned to anything
"B023", # function doesn't bind loop variable - will have last iteration's value
"B904", # raise inside except without from
"E101", # indentation contains mixed spaces and tabs
"E402", # module level import not at top of file
"E501", # line too long
"E741", # ambiguous variable name
"F401", # "unused" imports
"F403", # can't detect undefined names from * import
"F405", # can't detect undefined names from * import
"F722", # syntax error in forward type annotation
"W191", # indentation contains tabs
"UP030", # Use implicit references for positional format fields (translations)
"UP031", # Use format specifiers instead of percent format
"UP032", # Use f-string instead of `format` call (translations)
"UP037", # quoted annotations
"UP040", # Use type aliases instead of type annotations
# --- Deliberate, not debt -------------------------------------------------
# This product writes typographic characters into user-facing strings on
# purpose: "->" arrows on confirmation cards, "·" separators, curly quotes in
# persona copy. Ruff cannot tell those from a homoglyph attack, and we are
# not going to ASCII-ify the UI to satisfy it.
"RUF001", # ambiguous unicode character in a string
"RUF002", # ambiguous unicode character in a docstring
"RUF003", # ambiguous unicode character in a comment
# --- Pre-existing debt, enabled 2026-07-17 --------------------------------
# The linter was configured but never enforced (the pre-commit hook was
# never installed), so 96 violations accumulated. 22 were auto-fixed when
# the hook went in; these 11 rules cover the 75 that need a human decision -
# several are behavioural (B905 changes what zip() does on unequal lengths;
# F841 can be hiding a real bug). Ignored HERE so the rule stays enforced
# for every other rule and all new code, rather than left un-run.
# Burn these down file-by-file; delete each line as it hits zero.
# Cleared 2026-07-20: B905 (4), F841 (11), RUF007 (2) - the behavioural ones.
"B007", # loop control variable not used in the body (4)
"RUF005", # prefer iterable unpacking over concatenation (3)
"RUF012", # mutable class default needs ClassVar - may be a bug (8)
"RUF013", # implicit Optional in a type annotation (1)
"RUF015", # unnecessary allocation to grab the first element (5)
"RUF046", # unnecessary int() cast (2)
"RUF059", # unused variable in an unpacking assignment (8)
"UP028", # yield in a for loop, use yield from (2)
]
typing-modules = ["frappe.types.DF"]
[tool.ruff.format]
quote-style = "double"
indent-style = "tab"
docstring-code-format = true