dataerai-cli-beta 0.1.0__py3-none-macosx_11_0_arm64.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.
@@ -0,0 +1,7 @@
1
+ """`dataerai-cli*` — a thin pip launcher for the bundled `dataerai` Go binary.
2
+
3
+ The wheel ships the platform `dataerai` binary in ``dataerai_cli/_bin/`` and
4
+ exposes it as the ``dataerai`` console command. The three environment packages
5
+ (`dataerai-cli`, `-beta`, `-dev`) are identical except for the DEFAULT_SERVER
6
+ baked into ``__main__.py`` at build time.
7
+ """
@@ -0,0 +1,68 @@
1
+ """Console entry point for the bundled `dataerai` binary.
2
+
3
+ `pip install dataerai-cli[-beta|-dev]` exposes this as the `dataerai` command.
4
+ The only thing that differs between the three environment packages is
5
+ ``DEFAULT_SERVER`` below, which ``packaging/build_cli_wheels.py`` rewrites at
6
+ build time. An explicit ``DATAERAI_SERVER`` in the environment always wins, so
7
+ a user can still point any wheel at any instance.
8
+ """
9
+ from __future__ import annotations
10
+
11
+ import os
12
+ import stat
13
+ import sys
14
+ from pathlib import Path
15
+
16
+ # >>> Rewritten per environment at build time — do not hand-edit. <<<
17
+ DEFAULT_SERVER = "https://beta.dataerai.com"
18
+ DEFAULT_CLIENT_ID = "dataerai-cli"
19
+
20
+
21
+ def _binary_path() -> Path:
22
+ exe = "dataerai.exe" if os.name == "nt" else "dataerai"
23
+ return Path(__file__).resolve().with_name("_bin") / exe
24
+
25
+
26
+ def main() -> int:
27
+ binary = _binary_path()
28
+ if not binary.exists():
29
+ sys.stderr.write(f"dataerai: bundled binary missing at {binary}\n")
30
+ return 1
31
+
32
+ # Default the target instance for this wheel; respect an explicit override.
33
+ # Use "empty counts as unset" (not setdefault) so `DATAERAI_SERVER=` from a
34
+ # Docker/k8s env block falls back to the baked default instead of an empty URL.
35
+ if not os.environ.get("DATAERAI_SERVER"):
36
+ os.environ["DATAERAI_SERVER"] = DEFAULT_SERVER
37
+ if not os.environ.get("DATAERAI_CLIENT_ID"):
38
+ os.environ["DATAERAI_CLIENT_ID"] = DEFAULT_CLIENT_ID
39
+
40
+ args = [str(binary), *sys.argv[1:]]
41
+ if os.name == "nt":
42
+ # Windows has no exec-replace; run as a child and propagate the code.
43
+ import subprocess
44
+
45
+ return subprocess.call(args)
46
+
47
+ # POSIX: ensure +x (wheels usually preserve it) then replace this process so
48
+ # signals / exit codes pass straight through. A read-only install may forbid
49
+ # chmod — try execv anyway rather than crashing on the chmod.
50
+ mode = binary.stat().st_mode
51
+ if not mode & stat.S_IXUSR:
52
+ try:
53
+ binary.chmod(mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
54
+ except OSError:
55
+ pass
56
+ try:
57
+ os.execv(str(binary), args) # never returns on success
58
+ except OSError as e:
59
+ # e.g. a noexec mount, EACCES, or an arch-mismatched binary: emit the
60
+ # same clean one-liner as the missing-binary case rather than crashing
61
+ # the user with a Python traceback.
62
+ sys.stderr.write(f"dataerai: failed to exec bundled binary at {binary}: {e}\n")
63
+ return 1
64
+ return 0 # pragma: no cover
65
+
66
+
67
+ if __name__ == "__main__":
68
+ raise SystemExit(main())
Binary file
@@ -0,0 +1,6 @@
1
+ Metadata-Version: 2.4
2
+ Name: dataerai-cli-beta
3
+ Version: 0.1.0
4
+ Summary: DataErai CLI (bundled binary) — targets https://beta.dataerai.com
5
+ Requires-Python: >=3.10
6
+ Requires-Dist: dataerai-sdk>=0.1.0
@@ -0,0 +1,8 @@
1
+ dataerai_cli/__init__.py,sha256=oaujNEzObpAYMHUwl9854vVgpG7FtIskCrtCE8_EEXY,362
2
+ dataerai_cli/__main__.py,sha256=8uIQMDTpi90EBMI5-6tYkHID5aSq9oYDXnRSPtA8IbY,2570
3
+ dataerai_cli/_bin/dataerai,sha256=So1f1Em8VBBaY2oOh7O__-sYiTgzy8v2rS5bQR2m8DA,14430402
4
+ dataerai_cli_beta-0.1.0.dist-info/METADATA,sha256=OpbFci69Qr1GRgSSjoOq22afr-PTIFAq3uBUo3iMCOI,197
5
+ dataerai_cli_beta-0.1.0.dist-info/WHEEL,sha256=Z6mzVRPsUIMYJiM4fMxj6mRCHHJ84W5Tdj2zIFj4i1E,105
6
+ dataerai_cli_beta-0.1.0.dist-info/entry_points.txt,sha256=KWfMqpFV0JXartJM5jKkuyVFxLlhqzpAFCEZUL4bftw,56
7
+ dataerai_cli_beta-0.1.0.dist-info/top_level.txt,sha256=tQHodnDF9RMd7BHfPndAMC9EDQJULBWCjAPPWVb5ZFc,13
8
+ dataerai_cli_beta-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-macosx_11_0_arm64
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ dataerai = dataerai_cli.__main__:main
@@ -0,0 +1 @@
1
+ dataerai_cli