-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpyproject.toml
More file actions
162 lines (150 loc) · 6.31 KB
/
Copy pathpyproject.toml
File metadata and controls
162 lines (150 loc) · 6.31 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "openadapt-grounding"
version = "0.1.2"
description = "Robust UI element localization for automation"
readme = "README.md"
requires-python = ">=3.10"
license = "MIT"
authors = [
{name = "Richard Abrich", email = "richard@openadapt.ai"}
]
maintainers = [
{name = "OpenAdaptAI", email = "info@openadapt.ai"}
]
keywords = ["grounding", "ui", "localization", "automation", "vlm", "vision", "ocr", "omniparser"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"pillow>=10.0.0",
"pytesseract>=0.3.10",
"requests>=2.31.0",
]
[project.optional-dependencies]
dev = [
"pytest>=8.0.0",
# Bounded on purpose. `ruff>=0.1.0` unpinned means `ruff check` here answers
# differently depending on the day it is run: ruff 0.16.0 grew its DEFAULT
# rule set from 59 rules to 413, and this project selected no rules
# explicitly, so it silently inherited 354 new ones. This tree reported 0
# findings under the locked ruff 0.14.11 and 351 under 0.16.0. There is no
# lint CI in this repo, so nothing went red -- the failure mode was worse
# than red: two people running `ruff check .` a week apart got different
# answers and neither was wrong. Raise the ceiling deliberately, with the
# findings cleared in the same change.
"ruff>=0.16,<0.17",
]
deploy = [
"boto3>=1.34.0",
"paramiko>=3.4.0",
"pydantic-settings>=2.0.0",
"fire>=0.5.0",
]
uitars = [
"openai>=1.0.0",
]
eval = [
"matplotlib>=3.7.0",
"tqdm>=4.65.0",
"fire>=0.5.0",
"pydantic-settings>=2.0.0",
]
# VLM API providers
providers-anthropic = [
"anthropic>=0.40.0",
]
providers-openai = [
"openai>=1.0.0",
]
providers-google = [
"google-genai>=1.0.0",
]
providers = [
"openadapt-grounding[providers-anthropic,providers-openai,providers-google]",
]
all = [
"openadapt-grounding[dev,deploy,uitars,eval,providers]",
]
[project.urls]
Homepage = "https://github.com/OpenAdaptAI/openadapt-grounding"
Repository = "https://github.com/OpenAdaptAI/openadapt-grounding"
Documentation = "https://github.com/OpenAdaptAI/openadapt-grounding#readme"
Issues = "https://github.com/OpenAdaptAI/openadapt-grounding/issues"
Changelog = "https://github.com/OpenAdaptAI/openadapt-grounding/releases"
[tool.hatch.build.targets.wheel]
packages = ["src/openadapt_grounding"]
[tool.ruff]
line-length = 100
target-version = "py310"
# There is deliberately no `select` here: this project keeps ruff's FULL
# default rule set. The residual after safe autofix was 58 findings, small
# enough to open and judge one by one, and the rules doing the judging are the
# ones worth keeping -- RUF012 found `SUPPORTED_MODELS` handed out by
# reference, S112 found evaluation runs that reported a dead backend as a 0%
# score, RUF013 found `crop_sizes or [...]` overriding an explicit empty list,
# and BLE001 pointed at the OCR catch in `locator.py` that turned a missing
# tesseract into a confident stale click. Narrowing to `["E","F","I","W"]`
# would have found none of them.
#
# Predictability comes from the bounded `ruff>=0.16,<0.17` in the dev extra
# above, not from pinning the rule list: ruff only grows its default set in a
# minor release, so the set cannot move until a person raises that ceiling and
# owns the new findings in the same change. This repo has no lint CI, so that
# bound is the only thing making `ruff check .` reproducible here.
[tool.ruff.lint]
# BLE001 (blind `except Exception`) is the one rule in ruff 0.16's expanded
# defaults that is wrong for this codebase, so it is disabled deliberately
# rather than suppressed at twenty-odd individual sites.
#
# Sixteen of the remaining sites are in `deploy/deploy.py` and
# `deploy/uitars/deploy.py`, which are operator-facing CLIs that drive boto3,
# paramiko and `requests` against live AWS. Every handler prints the exception
# and degrades on purpose -- returns None, skips auto-shutdown setup, retries
# the SSH connect, continues cleaning up the next resource -- because a
# deployment tool that aborts with a traceback halfway through provisioning
# leaves the operator paying for orphaned infrastructure.
#
# There is also nothing to narrow to. botocore raises `ClientError` but also
# `BotoCoreError`, `NoCredentialsError` and `EndpointConnectionError`; paramiko
# raises `SSHException` and bare socket errors; `requests` raises its own
# hierarchy. They share no base. Enumerating them would reintroduce
# abort-on-first-surprise the next time a vendor added an exception type, which
# is a behaviour change, not a style change. Where a narrow base class DID
# exist it was used -- see `requests.RequestException` in
# `deploy/uitars/deploy.py::Deploy.wait`.
#
# Where a blind catch was hiding a defect rather than guarding a boundary, the
# code was fixed instead of ignored: `locator.ElementLocator._run_ocr`,
# `eval/methods/omniparser.py`, `eval/methods/uitars.py` and
# `eval/config.get_settings` all now report why they failed.
ignore = ["BLE001"]
[tool.ruff.lint.per-file-ignores]
# RUF022 wants `__all__` sorted alphabetically. All three of these are grouped
# by subsystem with `# Types` / `# Core` / `# Parsers` / `# Dataset` /
# `# Metrics` headings, and an alphabetical sort strands every comment against
# an unrelated name. The grouping documents the package layout and is worth
# more than the ordering, so the rule is turned off for these three files
# rather than repo-wide.
"src/openadapt_grounding/__init__.py" = ["RUF022"]
"src/openadapt_grounding/eval/__init__.py" = ["RUF022"]
"src/openadapt_grounding/providers/__init__.py" = ["RUF022"]
[tool.semantic_release]
version_toml = ["pyproject.toml:project.version"]
commit_message = "chore: release {version}"
[tool.semantic_release.branches.main]
match = "main"
[tool.semantic_release.commit_parser_options]
allowed_tags = ["build", "chore", "ci", "docs", "feat", "fix", "perf", "refactor", "style", "test"]
minor_tags = ["feat"]
patch_tags = ["fix", "perf"]