marathon-mac 0.1.1__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.
marathon_mac/__init__.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"""Runs the prebuilt `marathon` command, downloading it on first use.
|
|
2
|
+
|
|
3
|
+
The release that matches this package's version is fetched from GitHub,
|
|
4
|
+
checked against its SHA-256, and cached in ~/Library/Caches/marathon-mac.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import hashlib
|
|
8
|
+
import os
|
|
9
|
+
import platform
|
|
10
|
+
import shutil
|
|
11
|
+
import sys
|
|
12
|
+
import tarfile
|
|
13
|
+
import tempfile
|
|
14
|
+
import urllib.request
|
|
15
|
+
from importlib.metadata import version as _version
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
|
|
18
|
+
ASSET = "Marathon-macos-arm64.tar.gz"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _binary() -> Path:
|
|
22
|
+
v = _version("marathon-mac")
|
|
23
|
+
root = Path.home() / "Library" / "Caches" / "marathon-mac" / v
|
|
24
|
+
binary = root / "Marathon.app" / "Contents" / "Helpers" / "marathon"
|
|
25
|
+
if binary.exists():
|
|
26
|
+
return binary
|
|
27
|
+
if sys.platform != "darwin" or platform.machine() != "arm64":
|
|
28
|
+
sys.exit("marathon: Marathon needs an Apple Silicon Mac.")
|
|
29
|
+
url = f"https://github.com/abe238/marathon/releases/download/v{v}/{ASSET}"
|
|
30
|
+
with urllib.request.urlopen(url) as r:
|
|
31
|
+
data = r.read()
|
|
32
|
+
with urllib.request.urlopen(url + ".sha256") as r:
|
|
33
|
+
want = r.read().decode().split()[0]
|
|
34
|
+
got = hashlib.sha256(data).hexdigest()
|
|
35
|
+
if want != got:
|
|
36
|
+
sys.exit(f"marathon: checksum mismatch (expected {want}, got {got})")
|
|
37
|
+
root.parent.mkdir(parents=True, exist_ok=True)
|
|
38
|
+
tmp = Path(tempfile.mkdtemp(dir=root.parent))
|
|
39
|
+
try:
|
|
40
|
+
archive = tmp / ASSET
|
|
41
|
+
archive.write_bytes(data)
|
|
42
|
+
with tarfile.open(archive) as t:
|
|
43
|
+
if sys.version_info >= (3, 12):
|
|
44
|
+
t.extractall(tmp, filter="tar")
|
|
45
|
+
else:
|
|
46
|
+
t.extractall(tmp)
|
|
47
|
+
archive.unlink()
|
|
48
|
+
shutil.rmtree(root, ignore_errors=True)
|
|
49
|
+
tmp.rename(root)
|
|
50
|
+
finally:
|
|
51
|
+
shutil.rmtree(tmp, ignore_errors=True)
|
|
52
|
+
return binary
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def main() -> None:
|
|
56
|
+
binary = str(_binary())
|
|
57
|
+
os.execv(binary, [binary, *sys.argv[1:]])
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: marathon-mac
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Keep your Mac awake while AI agents and local models work. The marathon command, prebuilt.
|
|
5
|
+
Project-URL: Homepage, https://marathon.abediaz.ai
|
|
6
|
+
Project-URL: Source, https://github.com/abe238/marathon
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
Keywords: ai-agents,caffeinate,claude-code,codex,keep-awake,macos
|
|
9
|
+
Classifier: Environment :: MacOS X
|
|
10
|
+
Classifier: Operating System :: MacOS
|
|
11
|
+
Classifier: Topic :: Utilities
|
|
12
|
+
Requires-Python: >=3.9
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
# marathon-mac
|
|
16
|
+
|
|
17
|
+
Keep your Mac awake while your AI agents and local models work. This package runs the
|
|
18
|
+
prebuilt `marathon` command from [Marathon](https://github.com/abe238/marathon), downloading
|
|
19
|
+
it once on first use.
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
uvx marathon-mac on 2h
|
|
23
|
+
pipx install marathon-mac && marathon ai on
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Apple Silicon, macOS 14+. For the menu bar app, see https://marathon.abediaz.ai.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
marathon_mac/__init__.py,sha256=tZFNmQCbrzEEVHmiF8jpDbM_EZBv8F1FORp-R7WYpR0,1850
|
|
2
|
+
marathon_mac-0.1.1.dist-info/METADATA,sha256=bJO3CmJQu44E-x5U6k7YQvhuChcmuyH6LgYg1GIOoWs,903
|
|
3
|
+
marathon_mac-0.1.1.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
4
|
+
marathon_mac-0.1.1.dist-info/entry_points.txt,sha256=V4mBduMvVnuaaGjmr5SZmkHbIh7BQIW2MYCJMXGdDXQ,47
|
|
5
|
+
marathon_mac-0.1.1.dist-info/RECORD,,
|