marathon-mac 0.1.1__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.
@@ -0,0 +1,3 @@
1
+ /target
2
+ /dist
3
+ .DS_Store
@@ -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,12 @@
1
+ # marathon-mac
2
+
3
+ Keep your Mac awake while your AI agents and local models work. This package runs the
4
+ prebuilt `marathon` command from [Marathon](https://github.com/abe238/marathon), downloading
5
+ it once on first use.
6
+
7
+ ```
8
+ uvx marathon-mac on 2h
9
+ pipx install marathon-mac && marathon ai on
10
+ ```
11
+
12
+ Apple Silicon, macOS 14+. For the menu bar app, see https://marathon.abediaz.ai.
@@ -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,24 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "marathon-mac"
7
+ version = "0.1.1"
8
+ description = "Keep your Mac awake while AI agents and local models work. The marathon command, prebuilt."
9
+ readme = "README.md"
10
+ license = "Apache-2.0"
11
+ requires-python = ">=3.9"
12
+ keywords = ["macos", "caffeinate", "keep-awake", "ai-agents", "claude-code", "codex"]
13
+ classifiers = [
14
+ "Environment :: MacOS X",
15
+ "Operating System :: MacOS",
16
+ "Topic :: Utilities",
17
+ ]
18
+
19
+ [project.urls]
20
+ Homepage = "https://marathon.abediaz.ai"
21
+ Source = "https://github.com/abe238/marathon"
22
+
23
+ [project.scripts]
24
+ marathon = "marathon_mac:main"