-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathpyproject.toml
More file actions
240 lines (221 loc) · 6.7 KB
/
pyproject.toml
File metadata and controls
240 lines (221 loc) · 6.7 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
[project]
name = "askui"
description = "Automate computer tasks in Python"
authors = [
{name = "askui GmbH", email = "info@askui.com"},
]
dependencies = [
"anthropic>=0.72.0",
"fastapi>=0.115.12",
"fastmcp>=2.3.0",
"gradio-client>=1.4.3",
"grpcio>=1.73.1",
"httpx>=0.28.1",
"Jinja2>=3.1.4",
"openai>=1.61.1",
"opentelemetry-sdk>=1.38.0",
"pillow>=11.0.0",
"py-machineid>=0.7.0",
"pydantic-settings>=2.9.1",
"pydantic>=2.11.0",
"pyperclip>=1.9.0",
"python-dateutil>=2.9.0.post0",
"requests>=2.32.3",
"segment-analytics-python>=2.3.4",
"tenacity>=9.1.2",
"jsonref>=1.1.0",
"protobuf>=6.31.1",
"google-genai>=1.20.0",
"filetype>=1.2.0",
"markitdown[xls,xlsx,docx]>=0.1.2",
"asyncer==0.0.8",
"bson>=0.5.10",
"aiofiles>=24.1.0",
"anyio==4.10.0", # We need to pin this version otherwise listing mcp tools using fastmcp within runner fails
"sqlalchemy[mypy]>=2.0.44",
"apscheduler==4.0.0a6",
"opentelemetry-api>=1.38.0",
"imagehash>=4.3.0",
]
requires-python = ">=3.10,<3.14"
readme = "README.md"
license = {text = "MIT"}
dynamic = ["version"]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.version]
path = "src/askui/__init__.py"
[tool.pdm]
distribution = true
[tool.pdm.scripts]
test = "pytest -n auto"
"test:cov" = "pytest -n auto --cov=src/askui --cov-report=html"
"test:cov:view" = "python -m http.server --directory htmlcov"
"test:e2e" = "pytest -n auto tests/e2e"
"test:e2e:cov" = "pytest -n auto tests/e2e --cov=src/askui --cov-report=html"
"test:integration" = "pytest -n auto tests/integration"
"test:integration:cov" = "pytest -n auto tests/integration --cov=src/askui --cov-report=html"
"test:unit" = "pytest -n auto tests/unit"
"test:unit:cov" = "pytest -n auto tests/unit --cov=src/askui --cov-report=html"
format = "ruff format src tests"
lint = "ruff check src tests"
"lint:fix" = "ruff check --fix src tests"
typecheck = "mypy"
"typecheck:all" = "mypy ."
"generate:SBOM" = "cyclonedx-py environment --pyproject ./pyproject.toml --output-format JSON --output-file bom.json --spec-version 1.6 --gather-license-texts "
"qa:fix" = { composite = [
"typecheck:all",
"format",
"lint:fix",
] }
"grpc:gen" = "bash scripts/grpc-gen.sh"
"json:gen" = "datamodel-codegen --output-model-type pydantic_v2.BaseModel --input src/askui/tools/askui/askui_ui_controller_grpc/json_schema/ --input-file-type jsonschema --output src/askui/tools/askui/askui_ui_controller_grpc/generated/ --use-title-as-name "
[dependency-groups]
dev = [
"pytest>=8.3.4",
"ruff>=0.9.5",
"pytest-mock>=3.14.0",
"pytest-xdist>=3.6.1",
"pytest-cov>=4.1.0",
"mypy>=1.9.0",
"types-requests>=2.31.0.20240311",
"types-python-dateutil>=2.8.19.20240106",
"types-Pillow>=10.2.0.20240311",
"types-protobuf>=4.24.0.20240311",
"grpc-stubs>=1.53.0.3",
"types-pyperclip>=1.8.2.20240311",
"pytest-timeout>=2.4.0",
"types-pynput>=1.8.1.20250318",
"playwright>=1.41.0",
"pytest-asyncio>=1.1.0",
"datamodel-code-generator>=0.31.2",
"grpcio-tools>=1.73.1",
"types-aiofiles>=24.1.0.20250822",
"cyclonedx-bom>=7.2.1",
]
[tool.pytest.ini_options]
python_classes = ["Test*"]
python_files = ["test_*.py"]
python_functions = ["test_*"]
testpaths = ["tests"]
timeout = 60
asyncio_default_fixture_loop_scope = "session"
[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
"src/askui/tools/askui/askui_ui_controller_grpc/generated"
]
# Same as Black.
line-length = 88
# Assume Python 3.10
target-version = "py310"
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.ruff.lint]
# Enable all rules
select = ["ALL"]
ignore = [
"ANN", # Type annotations - handled by mypy
"COM812", # Unused import
"D", # Documentation - we'll handle this separately
"ERA", # Commented out code
"FBT", # Boolean trap
"ICN", # Import conventions
"ISC", # Implicit string concatenation
"N", # Naming
"PGH", # PyGithub
"PL", # Pylint
"PT", # Pytest
"Q", # Quotes
"RUF", # Ruff-specific rules
"S", # Bandit
"SIM", # Simplify
"T", # Pycodestyle
"TID", # isort
"UP", # Pyupgrade
"W", # Pycodestyle
"YTT", # flake8-2020
]
# Allow autofix for all enabled rules
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.per-file-ignores]
"src/askui/agent.py" = ["E501"]
"src/askui/android_agent.py" = ["E501"]
"src/askui/locators/locators.py" = ["E501"]
"src/askui/locators/relatable.py" = ["E501", "SLF001"]
"src/askui/locators/serializers.py" = ["E501", "SLF001"]
"src/askui/models/anthropic/computer_agent.py" = ["E501"]
"src/askui/models/askui/ai_element_utils.py" = ["E501"]
"src/askui/models/huggingface/spaces_api.py" = ["E501"]
"src/askui/models/shared/android_agent.py" = ["E501"]
"src/askui/prompts/system.py" = ["E501"]
"src/askui/reporting.py" = ["E501"]
"src/askui/telemetry/telemetry.py" = ["E501"]
"src/askui/tools/askui/askui_ui_controller_grpc/*" = ["ALL"]
"src/askui/utils/image_utils.py" = ["E501"]
"src/askui/web_agent.py" = ["E501"]
"tests/*" = ["S101", "PLR2004", "SLF001"]
"tests/e2e/agent/test_get.py" = ["E501"]
"tests/e2e/agent/test_locate_with_relations.py" = ["E501"]
"tests/unit/locators/serializers/test_askui_locator_serializer.py" = ["E501"]
"tests/unit/locators/serializers/test_locator_string_representation.py" = ["E501"]
"tests/unit/locators/test_locators.py" = ["E501"]
"tests/unit/utils/test_image_utils.py" = ["E501"]
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
inline-quotes = "double"
multiline-quotes = "double"
[tool.ruff.lint.isort]
known-first-party = ["askui"]
known-third-party = ["pytest", "mypy"]
[project.optional-dependencies]
all = ["askui[android,bedrock,vertex,web]"]
android = [
"pure-python-adb>=0.3.0.dev0"
]
bedrock = [
"anthropic[bedrock]>=0.72.0"
]
otel = [
"prometheus-fastapi-instrumentator>=7.1.0",
"opentelemetry-api>=1.38.0",
"opentelemetry-instrumentation-fastapi>=0.59b0",
"opentelemetry-exporter-otlp-proto-http>=1.38.0",
"opentelemetry-instrumentation-httpx>=0.59b0",
"opentelemetry-instrumentation-sqlalchemy>=0.59b0",
]
vertex = [
"google-cloud-aiplatform>=1.122.0",
"anthropic[vertex]>=0.72.0",
]
web = [
"playwright>=1.41.0",
]