drift-ml 0.1.10__py3-none-any.whl → 0.1.11__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.
- drift/engine_launcher.py +26 -10
- {drift_ml-0.1.10.dist-info → drift_ml-0.1.11.dist-info}/METADATA +1 -1
- {drift_ml-0.1.10.dist-info → drift_ml-0.1.11.dist-info}/RECORD +6 -6
- {drift_ml-0.1.10.dist-info → drift_ml-0.1.11.dist-info}/WHEEL +0 -0
- {drift_ml-0.1.10.dist-info → drift_ml-0.1.11.dist-info}/entry_points.txt +0 -0
- {drift_ml-0.1.10.dist-info → drift_ml-0.1.11.dist-info}/top_level.txt +0 -0
drift/engine_launcher.py
CHANGED
|
@@ -101,20 +101,38 @@ def _download_file(url: str, dest: Path) -> None:
|
|
|
101
101
|
headers["Accept"] = "application/octet-stream"
|
|
102
102
|
if token:
|
|
103
103
|
headers["Authorization"] = f"Bearer {token}"
|
|
104
|
-
|
|
104
|
+
|
|
105
|
+
def try_requests():
|
|
105
106
|
r = requests.get(url, headers=headers, stream=True, timeout=60)
|
|
106
107
|
r.raise_for_status()
|
|
107
108
|
with open(dest, "wb") as f:
|
|
108
109
|
for chunk in r.iter_content(chunk_size=65536):
|
|
109
110
|
f.write(chunk)
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
|
|
112
|
+
def try_urllib():
|
|
112
113
|
import urllib.request
|
|
113
114
|
req = urllib.request.Request(url, headers=headers)
|
|
114
115
|
with urllib.request.urlopen(req, timeout=60) as resp:
|
|
115
116
|
with open(dest, "wb") as f:
|
|
116
117
|
f.write(resp.read())
|
|
117
118
|
|
|
119
|
+
def try_curl():
|
|
120
|
+
result = subprocess.run(
|
|
121
|
+
["curl", "-fsSL", "-o", str(dest), url],
|
|
122
|
+
capture_output=True,
|
|
123
|
+
timeout=120,
|
|
124
|
+
)
|
|
125
|
+
if result.returncode != 0:
|
|
126
|
+
raise RuntimeError(f"curl failed: {result.stderr.decode() or result.returncode}")
|
|
127
|
+
|
|
128
|
+
for attempt in [try_curl, try_requests, try_urllib]:
|
|
129
|
+
try:
|
|
130
|
+
attempt()
|
|
131
|
+
return
|
|
132
|
+
except Exception:
|
|
133
|
+
continue
|
|
134
|
+
raise RuntimeError(f"Download failed. Try manually: curl -L -o {dest} {url}")
|
|
135
|
+
|
|
118
136
|
|
|
119
137
|
def ensure_engine() -> bool:
|
|
120
138
|
"""
|
|
@@ -145,13 +163,11 @@ def ensure_engine() -> bool:
|
|
|
145
163
|
try:
|
|
146
164
|
_download_file(url, bin_path)
|
|
147
165
|
except Exception as e:
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
print(f"drift: Try manually: curl -L -o {bin_path} {url}", file=sys.stderr)
|
|
154
|
-
return False
|
|
166
|
+
print(f"drift: Download failed: {e}", file=sys.stderr)
|
|
167
|
+
print(f"drift: Run this manually, then try again:", file=sys.stderr)
|
|
168
|
+
print(f" mkdir -p ~/.drift/bin && curl -L -o ~/.drift/bin/{asset} {url}", file=sys.stderr)
|
|
169
|
+
print(f" chmod +x ~/.drift/bin/{asset}", file=sys.stderr)
|
|
170
|
+
return False
|
|
155
171
|
if platform.system() != "Windows":
|
|
156
172
|
bin_path.chmod(0o755)
|
|
157
173
|
if platform.system() == "Darwin":
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
drift/__init__.py,sha256=X0NUP5ZAZSz-rBFfjvmmS4IYWP2_CZtu187mqwpWwqk,127
|
|
2
2
|
drift/__main__.py,sha256=r2mhZ3sCvDY7iEEiZoGDvUPei_CY24tfMQgs7Oal2yk,856
|
|
3
|
-
drift/engine_launcher.py,sha256=
|
|
3
|
+
drift/engine_launcher.py,sha256=DlnSRNeHdov_XfVQ-QvDyTTN0J-wQdTlSnx8N_6N_7o,6648
|
|
4
4
|
drift/cli/__init__.py,sha256=OQt7M06e98e_L_60Qz-HsmSqGXKWdH53SvgETJ_BZZ0,172
|
|
5
5
|
drift/cli/client.py,sha256=hGxz-J8fC_gGV9BZnpCBwkQZg4Q0_s9-Agk2PuXQ5MQ,5527
|
|
6
6
|
drift/cli/repl.py,sha256=hRnx4nfP_StnXDbdRZXnnjA8aNvrdQSV-uTNsuaaO60,8262
|
|
@@ -9,8 +9,8 @@ drift/llm_adapters/__init__.py,sha256=y1UhZWlC8Ik_OKfLcOp0JZP-FKR3MBBCemWwsL6Tnk
|
|
|
9
9
|
drift/llm_adapters/base.py,sha256=KlZUPYpvCI8pafklBWel0GHHLNtVKVwSHA92MZt3VsI,1331
|
|
10
10
|
drift/llm_adapters/gemini_cli.py,sha256=Z61wY3yFiZqPrQrpJAQrBtMbBkr2qLWBkni-A4p9lZo,2163
|
|
11
11
|
drift/llm_adapters/local_llm.py,sha256=Z6j6z1CXk2LMeQ5ZnY4o38PiYkHYmcIkgJGkHdU50M8,2279
|
|
12
|
-
drift_ml-0.1.
|
|
13
|
-
drift_ml-0.1.
|
|
14
|
-
drift_ml-0.1.
|
|
15
|
-
drift_ml-0.1.
|
|
16
|
-
drift_ml-0.1.
|
|
12
|
+
drift_ml-0.1.11.dist-info/METADATA,sha256=NMdqz6WMo0nNe81-4M3T96-FglpZOZouWyCM31q8YPE,169
|
|
13
|
+
drift_ml-0.1.11.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
14
|
+
drift_ml-0.1.11.dist-info/entry_points.txt,sha256=aCY7U9M8nhYj_tIfTXJmYkVmXY3ZoxF0tebDZzYswv8,46
|
|
15
|
+
drift_ml-0.1.11.dist-info/top_level.txt,sha256=3u2KGqsciGZQ2uCoBivm55t3e8er8S4xnqkgdQ_8oeM,6
|
|
16
|
+
drift_ml-0.1.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|