drift-ml 0.1.8__tar.gz → 0.1.9__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.1.8
3
+ Version: 0.1.9
4
4
  Summary: Terminal-first AutoML CLI - chat-based ML engineer
5
5
  Requires-Python: >=3.10
6
6
  Requires-Dist: requests>=2.28.0
@@ -61,14 +61,12 @@ def _engine_running() -> bool:
61
61
 
62
62
 
63
63
  def _get_asset_download_url(asset_name: str) -> str:
64
- """Resolve GitHub release asset to download URL."""
65
- # Direct URL works for public repos, no API rate limits
66
- direct_url = f"https://github.com/{GITHUB_REPO}/releases/download/{ENGINE_TAG}/{asset_name}"
67
- r = requests.head(direct_url, timeout=10, allow_redirects=True)
68
- if r.status_code == 200:
69
- return r.url # follow redirects to final URL
70
-
71
- # Fallback: API (needed for private repos or if direct fails)
64
+ """Resolve GitHub release asset to download URL. Prefer direct URL (no API)."""
65
+ return f"https://github.com/{GITHUB_REPO}/releases/download/{ENGINE_TAG}/{asset_name}"
66
+
67
+
68
+ def _get_asset_download_url_via_api(asset_name: str) -> str:
69
+ """Fallback: get URL via GitHub API (for private repos)."""
72
70
  token = os.environ.get("DRIFT_GITHUB_TOKEN") or os.environ.get("GITHUB_TOKEN")
73
71
  headers = {
74
72
  "User-Agent": "Drift-Engine-Launcher/1.0",
@@ -137,8 +135,16 @@ def ensure_engine() -> bool:
137
135
  url = _get_asset_download_url(asset)
138
136
  _download_file(url, bin_path)
139
137
  except Exception as e:
140
- print(f"drift: Download failed: {e}", file=sys.stderr)
141
- return False
138
+ if "404" in str(e) or "Not Found" in str(e):
139
+ try:
140
+ url = _get_asset_download_url_via_api(asset)
141
+ _download_file(url, bin_path)
142
+ except Exception as e2:
143
+ print(f"drift: Download failed: {e2}", file=sys.stderr)
144
+ return False
145
+ else:
146
+ print(f"drift: Download failed: {e}", file=sys.stderr)
147
+ return False
142
148
  if platform.system() != "Windows":
143
149
  bin_path.chmod(0o755)
144
150
  if platform.system() == "Darwin":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: drift-ml
3
- Version: 0.1.8
3
+ Version: 0.1.9
4
4
  Summary: Terminal-first AutoML CLI - chat-based ML engineer
5
5
  Requires-Python: >=3.10
6
6
  Requires-Dist: requests>=2.28.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "drift-ml"
7
- version = "0.1.8"
7
+ version = "0.1.9"
8
8
  description = "Terminal-first AutoML CLI - chat-based ML engineer"
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