drift-ml 0.2.1__tar.gz → 0.2.2__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: drift-ml
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: drift — terminal-first, chat-based AutoML. Open source. No tokens. No auth.
5
5
  Project-URL: Homepage, https://github.com/lakshitsachdeva/intent2model
6
6
  Project-URL: Repository, https://github.com/lakshitsachdeva/intent2model
@@ -19,7 +19,7 @@ def main() -> None:
19
19
  from drift.engine_launcher import ensure_engine
20
20
 
21
21
  if not ensure_engine():
22
- print("drift: Failed to start engine. Set DRIFT_BACKEND_URL or run: npm install -g drift-ml", file=sys.stderr)
22
+ print("drift: Failed to start engine. Check ~/.drift/bin/.engine-stderr.log or set DRIFT_BACKEND_URL", file=sys.stderr)
23
23
  sys.exit(1)
24
24
  base_url = f"http://127.0.0.1:{os.environ.get('DRIFT_ENGINE_PORT', '8000')}"
25
25
  run_repl(base_url=base_url)
@@ -147,20 +147,38 @@ def ensure_engine() -> bool:
147
147
  pass
148
148
 
149
149
  env = {**os.environ, "DRIFT_ENGINE_PORT": ENGINE_PORT}
150
- proc = subprocess.Popen(
151
- [str(bin_path)],
152
- cwd=str(bin_dir),
153
- env=env,
154
- stdout=subprocess.DEVNULL,
155
- stderr=subprocess.DEVNULL,
156
- start_new_session=True,
157
- )
158
- proc.wait()
159
- del proc
150
+ stderr_file = bin_dir / ".engine-stderr.log"
151
+ proc = None
152
+ try:
153
+ with open(stderr_file, "w") as errf:
154
+ proc = subprocess.Popen(
155
+ [str(bin_path)],
156
+ cwd=str(bin_dir),
157
+ env=env,
158
+ stdout=subprocess.DEVNULL,
159
+ stderr=errf,
160
+ start_new_session=True,
161
+ )
162
+ try:
163
+ proc.wait(timeout=3)
164
+ if proc.returncode and proc.returncode != 0:
165
+ err = stderr_file.read_text().strip() if stderr_file.exists() else ""
166
+ print(f"drift: Engine exited with code {proc.returncode}", file=sys.stderr)
167
+ if err:
168
+ print(f"drift: {err[-400:]}", file=sys.stderr)
169
+ return False
170
+ except subprocess.TimeoutExpired:
171
+ pass # Engine still running
172
+ except Exception as e:
173
+ print(f"drift: Engine spawn failed: {e}", file=sys.stderr)
174
+ return False
160
175
 
176
+ import time
161
177
  for _ in range(60):
162
178
  if _engine_running():
163
179
  return True
164
- import time
165
180
  time.sleep(0.5)
181
+ err = stderr_file.read_text().strip() if stderr_file.exists() else ""
182
+ if err:
183
+ print(f"drift: Engine log: {err[-400:]}", file=sys.stderr)
166
184
  return False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: drift-ml
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: drift — terminal-first, chat-based AutoML. Open source. No tokens. No auth.
5
5
  Project-URL: Homepage, https://github.com/lakshitsachdeva/intent2model
6
6
  Project-URL: Repository, https://github.com/lakshitsachdeva/intent2model
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "drift-ml"
7
- version = "0.2.1"
7
+ version = "0.2.2"
8
8
  description = "drift — terminal-first, chat-based AutoML. Open source. No tokens. No auth."
9
9
  requires-python = ">=3.10"
10
10
  dependencies = [
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes