divi 0.0.1.dev9__tar.gz → 0.0.1.dev10__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.
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/PKG-INFO +1 -1
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/divi/__init__.py +1 -1
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/scripts/hatch_build.py +34 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/scripts/proto_build.py +8 -11
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/.gitignore +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/LICENSE +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/Makefile +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/README.md +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/apps/README.md +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/core/README.md +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/core/go.mod +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/core/go.sum +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/core/main.go +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/core/proto/core.pb.go +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/core/proto/core_grpc.pb.go +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/core/proto/health.pb.go +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/divi/core/__init__.py +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/divi/core/finish.py +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/divi/core/init.py +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/divi/core/run.py +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/divi/proto/core.proto +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/divi/proto/core_pb2.py +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/divi/proto/core_pb2.pyi +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/divi/proto/core_pb2_grpc.py +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/divi/proto/health.proto +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/divi/proto/health_pb2.py +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/divi/proto/health_pb2.pyi +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/divi/utils.py +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/docs/README.md +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/docs/package_readme.md +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/go.work +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/go.work.sum +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/hatch.toml +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/packages/README.md +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/pyproject.toml +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/scripts/README.md +0 -0
- {divi-0.0.1.dev9 → divi-0.0.1.dev10}/uv.lock +0 -0
@@ -1,11 +1,17 @@
|
|
1
1
|
import re
|
2
|
+
import shutil
|
3
|
+
import pathlib
|
2
4
|
import sysconfig
|
5
|
+
import subprocess
|
3
6
|
|
4
7
|
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
|
5
8
|
|
6
9
|
|
7
10
|
class CustomBuildHook(BuildHookInterface):
|
8
11
|
def initialize(self, version, build_data):
|
12
|
+
target_path = pathlib.Path("core", "main.go")
|
13
|
+
output_path = pathlib.Path("divi", "bin", "core")
|
14
|
+
self._go_build(target_path, output_path)
|
9
15
|
build_data["tag"] = f"py3-none-{self._get_platform_tag()}"
|
10
16
|
build_data["pure_python"] = False
|
11
17
|
|
@@ -45,3 +51,31 @@ class CustomBuildHook(BuildHookInterface):
|
|
45
51
|
if os == "linux":
|
46
52
|
parts[0] = "manylinux1"
|
47
53
|
return "_".join(parts)
|
54
|
+
|
55
|
+
def _go_build(
|
56
|
+
self,
|
57
|
+
target_path: pathlib.PurePath,
|
58
|
+
output_path: pathlib.PurePath,
|
59
|
+
):
|
60
|
+
"""go build -o output_path target_path"""
|
61
|
+
output_flags = ["-o", str(output_path)]
|
62
|
+
subprocess.check_call(
|
63
|
+
[
|
64
|
+
str(self._get_and_require_go_binary()),
|
65
|
+
"build",
|
66
|
+
*output_flags,
|
67
|
+
str(target_path),
|
68
|
+
],
|
69
|
+
)
|
70
|
+
|
71
|
+
def _get_and_require_go_binary(self) -> pathlib.Path:
|
72
|
+
go = shutil.which("go")
|
73
|
+
|
74
|
+
if not go:
|
75
|
+
self.app.abort(
|
76
|
+
"Did not find the 'go' binary. You need Go to build wandb"
|
77
|
+
" from source. See https://go.dev/doc/install.",
|
78
|
+
)
|
79
|
+
raise AssertionError("unreachable")
|
80
|
+
|
81
|
+
return pathlib.Path(go)
|
@@ -1,13 +1,10 @@
|
|
1
1
|
#!/usr/bin/env python
|
2
2
|
"""Compile proto files to python and go files."""
|
3
3
|
|
4
|
-
import importlib.metadata
|
5
4
|
import os
|
6
|
-
import pathlib
|
7
5
|
|
8
6
|
import grpc_tools # type: ignore
|
9
7
|
from grpc_tools import protoc # type: ignore
|
10
|
-
from packaging import version
|
11
8
|
|
12
9
|
|
13
10
|
proto_root = os.path.join(os.path.dirname(grpc_tools.__file__), "_proto")
|
@@ -23,9 +20,9 @@ for proto_file in [
|
|
23
20
|
proto_root,
|
24
21
|
"-I",
|
25
22
|
".",
|
26
|
-
|
27
|
-
|
28
|
-
|
23
|
+
"--python_out=.",
|
24
|
+
"--pyi_out=.",
|
25
|
+
"--go_out=.",
|
29
26
|
f"divi/proto/{proto_file}",
|
30
27
|
)
|
31
28
|
)
|
@@ -42,11 +39,11 @@ for proto_file in [
|
|
42
39
|
proto_root,
|
43
40
|
"-I",
|
44
41
|
".",
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
42
|
+
"--python_out=.",
|
43
|
+
"--pyi_out=.",
|
44
|
+
"--grpc_python_out=.",
|
45
|
+
"--go_out=.",
|
46
|
+
"--go-grpc_out=.",
|
50
47
|
f"divi/proto/{proto_file}",
|
51
48
|
)
|
52
49
|
)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|