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
241
242
243
244
245
246
247
|
From 6324fea96f39001a603f0f9a7c38e1bf79201f2c Mon Sep 17 00:00:00 2001
From: Claudia Pellegrino <claui@users.noreply.github.com>
Date: Thu, 27 Mar 2025 22:05:25 +0100
Subject: [PATCH 1/4] Arch-Linux-specific: install optdeps via pacman
---
aider/scrape.py | 34 +++++++++++++---------------------
1 file changed, 13 insertions(+), 21 deletions(-)
diff --git a/aider/scrape.py b/aider/scrape.py
index 7977a854..8ccef18f 100755
--- a/aider/scrape.py
+++ b/aider/scrape.py
@@ -18,9 +18,9 @@ def install_playwright(io):
try:
from playwright.sync_api import sync_playwright
- has_pip = True
+ has_playwright = True
except ImportError:
- has_pip = False
+ has_playwright = False
try:
with sync_playwright() as p:
@@ -29,40 +29,32 @@ def install_playwright(io):
except Exception:
has_chromium = False
- if has_pip and has_chromium:
+ if has_playwright and has_chromium:
return True
- pip_cmd = utils.get_pip_install(["aider-chat[playwright]"])
- chromium_cmd = "-m playwright install --with-deps chromium"
- chromium_cmd = [sys.executable] + chromium_cmd.split()
-
- cmds = ""
- if not has_pip:
- cmds += " ".join(pip_cmd) + "\n"
+ packages = []
+ if not has_playwright:
+ packages.append("python-playwright")
if not has_chromium:
- cmds += " ".join(chromium_cmd) + "\n"
+ packages.append("chromium")
+ pacman_cmd = ["sudo", "pacman", "-Syu", "--asdeps", "--noconfirm", *packages]
- text = f"""For the best web scraping, install Playwright:
+ text = f"""For the best web scraping, run pacman as follows:
-{cmds}
+{" ".join(pacman_cmd)}
See {urls.enable_playwright} for more info.
"""
io.tool_output(text)
- if not io.confirm_ask("Install playwright?", default="y"):
+ if not io.confirm_ask(f"Install {" and ".join(packages)}?", default="y"):
return
- if not has_pip:
- success, output = utils.run_install(pip_cmd)
+ if packages:
+ success, output = utils.run_install(pacman_cmd)
if not success:
io.tool_error(output)
return
- success, output = utils.run_install(chromium_cmd)
- if not success:
- io.tool_error(output)
- return
-
return True
--
2.49.0
From 95cf9e2579e201f0a549d371f00854006a62d619 Mon Sep 17 00:00:00 2001
From: Claudia Pellegrino <claui@users.noreply.github.com>
Date: Mon, 10 Mar 2025 14:43:05 +0100
Subject: [PATCH 2/4] Arch-Linux-specific: use system Chromium
---
aider/scrape.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/aider/scrape.py b/aider/scrape.py
index 8ccef18f..c3c828a6 100755
--- a/aider/scrape.py
+++ b/aider/scrape.py
@@ -24,7 +24,7 @@ def install_playwright(io):
try:
with sync_playwright() as p:
- p.chromium.launch()
+ p.chromium.launch(executable_path="/usr/bin/chromium")
has_chromium = True
except Exception:
has_chromium = False
@@ -130,7 +130,7 @@ class Scraper:
with sync_playwright() as p:
try:
- browser = p.chromium.launch()
+ browser = p.chromium.launch(executable_path="/usr/bin/chromium")
except Exception as e:
self.playwright_available = False
self.print_error(str(e))
--
2.49.0
From 55736fd692f88878683b2362761187644489964e Mon Sep 17 00:00:00 2001
From: Claudia Pellegrino <claui@users.noreply.github.com>
Date: Thu, 27 Mar 2025 22:06:15 +0100
Subject: [PATCH 3/4] Arch-Linux-specific: install boto3 via pacman
---
aider/models.py | 6 +++---
aider/utils.py | 32 ++++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+), 3 deletions(-)
diff --git a/aider/models.py b/aider/models.py
index a711065e..bf8bcc11 100644
--- a/aider/models.py
+++ b/aider/models.py
@@ -18,7 +18,7 @@ from PIL import Image
from aider.dump import dump # noqa: F401
from aider.llm import litellm
from aider.sendchat import ensure_alternating_roles, sanity_check_messages
-from aider.utils import check_pip_install_extra
+from aider.utils import check_archlinux_package, check_pip_install_extra
RETRY_TIMEOUT = 60
@@ -957,8 +957,8 @@ def check_for_dependencies(io, model_name):
"""
# Check if this is a Bedrock model and ensure boto3 is installed
if model_name.startswith("bedrock/"):
- check_pip_install_extra(
- io, "boto3", "AWS Bedrock models require the boto3 package.", ["boto3"]
+ check_archlinux_package(
+ io, "boto3", "python-boto3"
)
# Check if this is a Vertex AI model and ensure google-cloud-aiplatform is installed
diff --git a/aider/utils.py b/aider/utils.py
index 322a4431..1204db17 100644
--- a/aider/utils.py
+++ b/aider/utils.py
@@ -370,6 +370,38 @@ def check_pip_install_extra(io, module, prompt, pip_install_cmd, self_update=Fal
print(printable_shell_command(cmd))
+def check_archlinux_package(io, module, archlinux_package):
+ if module:
+ try:
+ __import__(module)
+ return True
+ except (ImportError, ModuleNotFoundError, RuntimeError):
+ pass
+
+ cmd = ["sudo", "pacman", "-Syu", "--asdeps", "--noconfirm", archlinux_package]
+ io.tool_warning("Using this feature requires a package to be installed.")
+
+ if not io.confirm_ask("Run pacman?", default="y", subject=printable_shell_command(cmd)):
+ return
+
+ success, output = run_install(cmd)
+ if success:
+ if not module:
+ return True
+ try:
+ __import__(module)
+ return True
+ except (ImportError, ModuleNotFoundError, RuntimeError) as err:
+ io.tool_error(str(err))
+ pass
+
+ io.tool_error(output)
+
+ print()
+ print("Install failed, try running this command manually:")
+ print(printable_shell_command(cmd))
+
+
def printable_shell_command(cmd_list):
"""
Convert a list of command arguments to a properly shell-escaped string.
--
2.49.0
From f9fb8c0f252abf35c935d1960f535f3f2343e95c Mon Sep 17 00:00:00 2001
From: Claudia Pellegrino <claui@users.noreply.github.com>
Date: Mon, 10 Mar 2025 12:17:21 +0100
Subject: [PATCH 4/4] AUR-specific: replace auto-updater with a notice
---
aider/versioncheck.py | 26 ++++----------------------
1 file changed, 4 insertions(+), 22 deletions(-)
diff --git a/aider/versioncheck.py b/aider/versioncheck.py
index ac511a02..bf1490ab 100644
--- a/aider/versioncheck.py
+++ b/aider/versioncheck.py
@@ -36,29 +36,11 @@ def install_upgrade(io, latest_version=None):
else:
new_ver_text = "Install latest version of aider?"
- docker_image = os.environ.get("AIDER_DOCKER_IMAGE")
- if docker_image:
- text = f"""
-{new_ver_text} To upgrade, run:
-
- docker pull {docker_image}
+ text = f"""
+{new_ver_text} To upgrade, use the latest version available on the AUR.
"""
- io.tool_warning(text)
- return True
-
- success = utils.check_pip_install_extra(
- io,
- None,
- new_ver_text,
- ["aider-chat"],
- self_update=True,
- )
-
- if success:
- io.tool_output("Re-run aider to use new version.")
- sys.exit()
-
- return
+ io.tool_warning(text)
+ return True
def check_version(io, just_check=False, verbose=False):
--
2.49.0
|