tunacode-cli 0.0.63__py3-none-any.whl → 0.0.65__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of tunacode-cli might be problematic. Click here for more details.
- tunacode/cli/commands/implementations/system.py +65 -0
- tunacode/constants.py +1 -1
- {tunacode_cli-0.0.63.dist-info → tunacode_cli-0.0.65.dist-info}/METADATA +1 -1
- {tunacode_cli-0.0.63.dist-info → tunacode_cli-0.0.65.dist-info}/RECORD +7 -7
- {tunacode_cli-0.0.63.dist-info → tunacode_cli-0.0.65.dist-info}/WHEEL +0 -0
- {tunacode_cli-0.0.63.dist-info → tunacode_cli-0.0.65.dist-info}/entry_points.txt +0 -0
- {tunacode_cli-0.0.63.dist-info → tunacode_cli-0.0.65.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""System-level commands for TunaCode CLI."""
|
|
2
2
|
|
|
3
|
+
import os
|
|
3
4
|
import shutil
|
|
4
5
|
import subprocess
|
|
5
6
|
import sys
|
|
@@ -107,6 +108,41 @@ class UpdateCommand(SimpleCommand):
|
|
|
107
108
|
except (subprocess.TimeoutExpired, subprocess.CalledProcessError):
|
|
108
109
|
pass
|
|
109
110
|
|
|
111
|
+
# Check if installed via venv (from install script)
|
|
112
|
+
if not installation_method:
|
|
113
|
+
venv_dir = os.path.expanduser("~/.tunacode-venv")
|
|
114
|
+
venv_tunacode = os.path.join(venv_dir, "bin", "tunacode")
|
|
115
|
+
venv_python = os.path.join(venv_dir, "bin", "python")
|
|
116
|
+
|
|
117
|
+
if os.path.exists(venv_tunacode) and os.path.exists(venv_python):
|
|
118
|
+
# Try UV first if available (UV-created venvs don't have pip module)
|
|
119
|
+
if shutil.which("uv"):
|
|
120
|
+
try:
|
|
121
|
+
result = subprocess.run(
|
|
122
|
+
["uv", "pip", "show", "--python", venv_python, "tunacode-cli"],
|
|
123
|
+
capture_output=True,
|
|
124
|
+
text=True,
|
|
125
|
+
timeout=10,
|
|
126
|
+
)
|
|
127
|
+
if result.returncode == 0:
|
|
128
|
+
installation_method = "venv"
|
|
129
|
+
except (subprocess.TimeoutExpired, subprocess.CalledProcessError):
|
|
130
|
+
pass
|
|
131
|
+
|
|
132
|
+
# Fall back to python -m pip for pip-created venvs
|
|
133
|
+
if not installation_method:
|
|
134
|
+
try:
|
|
135
|
+
result = subprocess.run(
|
|
136
|
+
[venv_python, "-m", "pip", "show", "tunacode-cli"],
|
|
137
|
+
capture_output=True,
|
|
138
|
+
text=True,
|
|
139
|
+
timeout=10,
|
|
140
|
+
)
|
|
141
|
+
if result.returncode == 0:
|
|
142
|
+
installation_method = "venv"
|
|
143
|
+
except (subprocess.TimeoutExpired, subprocess.CalledProcessError):
|
|
144
|
+
pass
|
|
145
|
+
|
|
110
146
|
# Check if installed via pip
|
|
111
147
|
if not installation_method:
|
|
112
148
|
try:
|
|
@@ -138,6 +174,35 @@ class UpdateCommand(SimpleCommand):
|
|
|
138
174
|
text=True,
|
|
139
175
|
timeout=60,
|
|
140
176
|
)
|
|
177
|
+
elif installation_method == "venv":
|
|
178
|
+
venv_dir = os.path.expanduser("~/.tunacode-venv")
|
|
179
|
+
venv_python = os.path.join(venv_dir, "bin", "python")
|
|
180
|
+
|
|
181
|
+
# Check if uv is available (same logic as install script)
|
|
182
|
+
if shutil.which("uv"):
|
|
183
|
+
await ui.info("Updating via UV in venv...")
|
|
184
|
+
result = subprocess.run(
|
|
185
|
+
[
|
|
186
|
+
"uv",
|
|
187
|
+
"pip",
|
|
188
|
+
"install",
|
|
189
|
+
"--python",
|
|
190
|
+
venv_python,
|
|
191
|
+
"--upgrade",
|
|
192
|
+
"tunacode-cli",
|
|
193
|
+
],
|
|
194
|
+
capture_output=True,
|
|
195
|
+
text=True,
|
|
196
|
+
timeout=60,
|
|
197
|
+
)
|
|
198
|
+
else:
|
|
199
|
+
await ui.info("Updating via pip in venv...")
|
|
200
|
+
result = subprocess.run(
|
|
201
|
+
[venv_python, "-m", "pip", "install", "--upgrade", "tunacode-cli"],
|
|
202
|
+
capture_output=True,
|
|
203
|
+
text=True,
|
|
204
|
+
timeout=60,
|
|
205
|
+
)
|
|
141
206
|
else: # pip
|
|
142
207
|
await ui.info("Updating via pip...")
|
|
143
208
|
result = subprocess.run(
|
tunacode/constants.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
tunacode/__init__.py,sha256=yUul8igNYMfUrHnYfioIGAqvrH8b5BKiO_pt1wVnmd0,119
|
|
2
|
-
tunacode/constants.py,sha256=
|
|
2
|
+
tunacode/constants.py,sha256=8cAm6_lIJiQ-o66ZdtYf2IA8G6KX397L_tZdyh7bl_Y,6100
|
|
3
3
|
tunacode/context.py,sha256=YtfRjUiqsSkk2k9Nn_pjb_m-AXyh6XcOBOJWtFI0wVw,2405
|
|
4
4
|
tunacode/exceptions.py,sha256=oDO1SVKOgjcKIylwqdbqh_g5my4roU5mB9Nv4n_Vb0s,3877
|
|
5
5
|
tunacode/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -18,7 +18,7 @@ tunacode/cli/commands/implementations/debug.py,sha256=ornvceGF4GbJd2OJXnnT9i9KpH
|
|
|
18
18
|
tunacode/cli/commands/implementations/development.py,sha256=I8jHgYY3VgjTU8its0D0ysruuVqKbNTBur0JjPIUIZA,2844
|
|
19
19
|
tunacode/cli/commands/implementations/model.py,sha256=uthx6IX9KwgwywNTDklkJpqCbaTX9h1_p-eVmqL73WQ,2245
|
|
20
20
|
tunacode/cli/commands/implementations/plan.py,sha256=iZtvdGPqvGqMr8_lYil8_8NOL1iyc54Bxtb0gb9VOnw,1825
|
|
21
|
-
tunacode/cli/commands/implementations/system.py,sha256=
|
|
21
|
+
tunacode/cli/commands/implementations/system.py,sha256=AtBhF44HalJrfh6F0Dl0NtdoIngqX-od2Uh_ucbogSM,10833
|
|
22
22
|
tunacode/cli/commands/implementations/template.py,sha256=YeFOjbKKfPswPCHPvlDUwXvg6J0MesyAyVsujiIgPbU,5482
|
|
23
23
|
tunacode/cli/commands/implementations/todo.py,sha256=Dtz5bgcuK2VXGPWEBBZQgnWUMYkRXNzTGf_qkVPLF2U,8125
|
|
24
24
|
tunacode/cli/repl_components/__init__.py,sha256=5ZjPJ3yUvZ5x6Vg9EYJ03-tdxfEEdmfradCmwSlVY3E,334
|
|
@@ -134,8 +134,8 @@ tunacode/utils/system.py,sha256=J8KqJ4ZqQrNSnM5rrJxPeMk9z2xQQp6dWtI1SKBY1-0,1112
|
|
|
134
134
|
tunacode/utils/text_utils.py,sha256=HAwlT4QMy41hr53cDbbNeNo05MI461TpI9b_xdIv8EY,7288
|
|
135
135
|
tunacode/utils/token_counter.py,sha256=dmFuqVz4ywGFdLfAi5Mg9bAGf8v87Ek-mHU-R3fsYjI,2711
|
|
136
136
|
tunacode/utils/user_configuration.py,sha256=Ilz8dpGVJDBE2iLWHAPT0xR8D51VRKV3kIbsAz8Bboc,3275
|
|
137
|
-
tunacode_cli-0.0.
|
|
138
|
-
tunacode_cli-0.0.
|
|
139
|
-
tunacode_cli-0.0.
|
|
140
|
-
tunacode_cli-0.0.
|
|
141
|
-
tunacode_cli-0.0.
|
|
137
|
+
tunacode_cli-0.0.65.dist-info/METADATA,sha256=Sv9EOkTz5Yg544b07rJ1mK8Hlt5pzPCcbNIOb7wW0IA,10930
|
|
138
|
+
tunacode_cli-0.0.65.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
139
|
+
tunacode_cli-0.0.65.dist-info/entry_points.txt,sha256=hbkytikj4dGu6rizPuAd_DGUPBGF191RTnhr9wdhORY,51
|
|
140
|
+
tunacode_cli-0.0.65.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
|
|
141
|
+
tunacode_cli-0.0.65.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|