eval-hub-server 0.4.0__py3-none-win_amd64.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,56 @@
1
+ """eval-hub server binary provider."""
2
+
3
+ import platform
4
+ from importlib.metadata import PackageNotFoundError
5
+ from importlib.metadata import version as _pkg_version
6
+ from pathlib import Path
7
+
8
+ try:
9
+ __version__ = _pkg_version("eval-hub-server")
10
+ except PackageNotFoundError:
11
+ __version__ = "0.0.0"
12
+
13
+
14
+ def get_binary_path():
15
+ """
16
+ Get the path to the platform-specific eval-hub binary.
17
+
18
+ Returns:
19
+ str: Absolute path to the binary
20
+
21
+ Raises:
22
+ FileNotFoundError: If binary for current platform is not found
23
+ RuntimeError: If platform is not supported
24
+ """
25
+ system = platform.system().lower()
26
+ machine = platform.machine().lower()
27
+
28
+ # Determine binary name
29
+ if system == "windows":
30
+ binary_name = "eval-hub-windows-amd64.exe"
31
+ elif system == "darwin":
32
+ binary_name = (
33
+ "eval-hub-darwin-arm64" if machine == "arm64" else "eval-hub-darwin-amd64"
34
+ )
35
+ elif system == "linux":
36
+ if "aarch64" in machine or "arm64" in machine:
37
+ binary_name = "eval-hub-linux-arm64"
38
+ else:
39
+ binary_name = "eval-hub-linux-amd64"
40
+ else:
41
+ raise RuntimeError(f"Unsupported platform: {system} {machine}")
42
+
43
+ # Find binary in package
44
+ package_dir = Path(__file__).parent
45
+ binary_path = package_dir / "binaries" / binary_name
46
+
47
+ if not binary_path.exists():
48
+ raise FileNotFoundError(
49
+ f"Binary not found: {binary_path}\n"
50
+ f"This package may not support your platform ({system} {machine})"
51
+ )
52
+
53
+ return str(binary_path)
54
+
55
+
56
+ __all__ = ["__version__", "get_binary_path"]
@@ -0,0 +1,42 @@
1
+ """Entry point for the eval-hub-server command."""
2
+
3
+ import subprocess
4
+ import sys
5
+
6
+ from evalhub_server import __version__, get_binary_path
7
+
8
+
9
+ def main(args=None):
10
+ """
11
+ Entry point for the eval-hub-server command.
12
+
13
+ Runs the eval-hub binary, passing through command-line arguments.
14
+
15
+ Args:
16
+ args: Optional list of command-line arguments to pass to the binary.
17
+ If None, defaults to sys.argv[1:].
18
+ """
19
+ # Use provided args or fall back to sys.argv[1:].
20
+ # args=None means the caller did not supply a list (e.g. setuptools entry point
21
+ # always calls main() with no arguments). In that case read sys.argv at runtime:
22
+ #
23
+ # - eval-hub-server --local ... → main() called with args=None → uses sys.argv[1:]
24
+ # - python main.py --local ... → main(sys.argv[1:]) called explicitly → args=['--local', ...]
25
+ # - main(['--local', ...]) in tests → args=['--local', ...] used as-is
26
+ if args is None:
27
+ args = sys.argv[1:]
28
+
29
+ # Get the path to the binary
30
+ binary_path = get_binary_path()
31
+
32
+ if "--version" in args or "-V" in args:
33
+ print(f"eval-hub-server {__version__}")
34
+ sys.exit(0)
35
+
36
+ # Pass all command-line arguments to the binary
37
+ result = subprocess.run([binary_path] + args)
38
+ sys.exit(result.returncode)
39
+
40
+
41
+ if __name__ == "__main__":
42
+ main(sys.argv[1:])
@@ -0,0 +1,98 @@
1
+ Metadata-Version: 2.4
2
+ Name: eval-hub-server
3
+ Version: 0.4.0
4
+ Summary: Server binary for eval-hub
5
+ Author-email: Rui Vieira <rui@redhat.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/eval-hub/eval-hub
8
+ Project-URL: Repository, https://github.com/eval-hub/eval-hub
9
+ Project-URL: Bug Tracker, https://github.com/eval-hub/eval-hub/issues
10
+ Keywords: eval-hub,binary,server
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
+ Requires-Python: >=3.11
20
+ Description-Content-Type: text/markdown
21
+ Provides-Extra: dev
22
+ Requires-Dist: ruff>=0.14.14; extra == "dev"
23
+ Requires-Dist: pytest>=9.0.3; extra == "dev"
24
+ Requires-Dist: mypy>=1.0; extra == "dev"
25
+ Requires-Dist: pyyaml>=6.0; extra == "dev"
26
+ Requires-Dist: types-PyYAML>=6.0; extra == "dev"
27
+
28
+ # eval-hub-server
29
+
30
+ This package is a thin Python wrapper that packages and distributes the compiled Go eval-hub server binary for multiple platforms. It handles platform detection and binary resolution so consumers can simply install and run.
31
+
32
+ It is primarily intended to be used as a dependency of `eval-hub-sdk`.
33
+
34
+ ## Installation
35
+
36
+ ```bash
37
+ pip install eval-hub-server
38
+ ```
39
+
40
+ ## Usage
41
+
42
+ ### CLI
43
+
44
+ ```bash
45
+ # Run with default settings (port 8080)
46
+ eval-hub-server
47
+
48
+ # Run in local mode
49
+ eval-hub-server --local
50
+
51
+ # Run with custom port 5000
52
+ PORT=5000 eval-hub-server --local
53
+ ```
54
+
55
+ ### Python module
56
+
57
+ ```bash
58
+ python -m evalhub_server.main --local
59
+ ```
60
+
61
+ ### Programmatically
62
+
63
+ Requires the package to be installed. `get_binary_path()` raises `FileNotFoundError` or `RuntimeError` if the binary for your platform is not available.
64
+
65
+ ```python
66
+ from evalhub_server import get_binary_path
67
+
68
+ # Get the path to the binary
69
+ binary_path = get_binary_path()
70
+
71
+ # Use it however you need (e.g., subprocess)
72
+ import subprocess
73
+ subprocess.run([binary_path, "--local"], check=True)
74
+ ```
75
+
76
+ ## Supported Platforms
77
+
78
+ - Linux: x86_64, arm64
79
+ - macOS: x86_64 (Intel), arm64 (Apple Silicon)
80
+ - Windows: x86_64
81
+
82
+ ## For eval-hub-sdk Users
83
+
84
+ If you're using [`eval-hub-sdk`](https://github.com/eval-hub/eval-hub-sdk), you can install the server binary as an extra:
85
+
86
+ ```bash
87
+ pip install eval-hub-sdk[server]
88
+ ```
89
+
90
+ For more information, see the [eval-hub-sdk repository](https://github.com/eval-hub/eval-hub-sdk).
91
+
92
+ ## Development
93
+
94
+ See [DEVELOPMENT.md](DEVELOPMENT.md) for build process details, local development setup, testing, and troubleshooting.
95
+
96
+ ## License
97
+
98
+ Apache-2.0
@@ -0,0 +1,8 @@
1
+ eval_hub_server-0.4.0.data/purelib/evalhub_server/__init__.py,sha256=CllKorIHoLaX406caubvA30wzHas9S0o2lPc_9DybTQ,1612
2
+ eval_hub_server-0.4.0.data/purelib/evalhub_server/main.py,sha256=qX2ZsIGJ0B9M1R1CxDSajNXQJLZQsiCAaatsWrOQRlM,1361
3
+ eval_hub_server-0.4.0.data/purelib/evalhub_server/binaries/eval-hub-windows-amd64.exe,sha256=JC8vKubsmlRjs_m69OkZ9ePeIFuZgJs-lZwRh2X9s54,73712640
4
+ eval_hub_server-0.4.0.dist-info/METADATA,sha256=aweuajQQnbXCVoPLHNLthSx9Pkhn-jAottzCeIixALk,2736
5
+ eval_hub_server-0.4.0.dist-info/WHEEL,sha256=GjDPPQwEcripVP6P2r3RxLa-h5Lb9ifGB7FYYtbLDT0,98
6
+ eval_hub_server-0.4.0.dist-info/entry_points.txt,sha256=t-jMxLpQSSdNFuFTRmYxndTTYa9_JyjWHRFgtVb-Z6A,61
7
+ eval_hub_server-0.4.0.dist-info/top_level.txt,sha256=axFz48HNOahJE0JjkgKPZHoV3m0psXLI9rhxnGQht3o,15
8
+ eval_hub_server-0.4.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: false
4
+ Tag: py3-none-win_amd64
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ eval-hub-server = evalhub_server.main:main
@@ -0,0 +1 @@
1
+ evalhub_server