splime 0.1.2__tar.gz → 0.1.3__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.
- {splime-0.1.2/src/splime.egg-info → splime-0.1.3}/PKG-INFO +1 -1
- {splime-0.1.2 → splime-0.1.3}/pyproject.toml +2 -1
- {splime-0.1.2 → splime-0.1.3}/src/spl/client.py +4 -4
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/repositories/env.py +3 -1
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/routes/envs.py +1 -1
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/store.py +1 -1
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon_client.py +5 -2
- {splime-0.1.2 → splime-0.1.3/src/splime.egg-info}/PKG-INFO +1 -1
- {splime-0.1.2 → splime-0.1.3}/LICENSE +0 -0
- {splime-0.1.2 → splime-0.1.3}/NOTICE +0 -0
- {splime-0.1.2 → splime-0.1.3}/README.md +0 -0
- {splime-0.1.2 → splime-0.1.3}/setup.cfg +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/__init__.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/core/__init__.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/core/common.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/core/entities/__init__.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/core/entities/adapter.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/core/entities/artifact.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/core/entities/control.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/core/entities/distribution.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/core/entities/function.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/core/entities/local_function.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/core/entities/misc.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/core/entities/module.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/core/entities/node.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/core/entities/node_function.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/core/entities/node_remote.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/core/entities/pipeline.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/core/entities/scalar.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/core/ir/__init__.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/core/ir/common.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/core/ir/parse.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/core/ir/unparse.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/core/ir/utils.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/__init__.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/__main__.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/cli.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/client.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/docker_environment.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/docker_pool.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/environment.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/environment_base.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/heartbeat_service.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/metadata.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/remote_client.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/repositories/__init__.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/repositories/library.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/repositories/object.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/repositories/run.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/repositories/server_connection.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/repositories/sync_event.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/routes/__init__.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/routes/_helpers.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/routes/artifacts.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/routes/diagnostics.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/routes/libraries.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/routes/objects.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/routes/remote.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/routes/runs.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/routes/server_connections.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/runtime_backend.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/runtime_config.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/runtime_dependencies.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/secret_store.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/server.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/server_connection.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/services/__init__.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/services/sync.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/signature.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/storage_base.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/daemon/worker.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/pipeline_widget.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/py.typed +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/spl/server_client.py +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/splime.egg-info/SOURCES.txt +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/splime.egg-info/dependency_links.txt +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/splime.egg-info/entry_points.txt +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/splime.egg-info/requires.txt +0 -0
- {splime-0.1.2 → splime-0.1.3}/src/splime.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "splime"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.3"
|
|
8
8
|
|
|
9
9
|
description = "Reuse Python functions across projects without rewriting or redeploying them."
|
|
10
10
|
readme = "README.md"
|
|
@@ -110,6 +110,7 @@ ignore = []
|
|
|
110
110
|
|
|
111
111
|
[tool.pytest.ini_options]
|
|
112
112
|
addopts = "-raq --strict-markers"
|
|
113
|
+
pythonpath = ["src"]
|
|
113
114
|
|
|
114
115
|
python_files = ["test_*.py", "tests.py"]
|
|
115
116
|
testpaths = ["tests"]
|
|
@@ -18,7 +18,6 @@ dependencies imported yet.
|
|
|
18
18
|
|
|
19
19
|
from __future__ import annotations
|
|
20
20
|
|
|
21
|
-
import sys
|
|
22
21
|
from dataclasses import dataclass, field, replace
|
|
23
22
|
from pathlib import Path
|
|
24
23
|
from typing import Any, Literal, cast, overload
|
|
@@ -463,14 +462,15 @@ class SPLClient:
|
|
|
463
462
|
def register_env(self, name: str = "default", python: str | None = None) -> dict[str, Any]:
|
|
464
463
|
"""Register a Python executable as a daemon environment.
|
|
465
464
|
|
|
466
|
-
By default the
|
|
467
|
-
|
|
465
|
+
By default the daemon registers its own interpreter. This keeps the
|
|
466
|
+
simplest local workflow working both when the daemon runs natively and
|
|
467
|
+
when it runs in a container:
|
|
468
468
|
|
|
469
469
|
client.register_env()
|
|
470
470
|
client.publish(my_function, env="default")
|
|
471
471
|
"""
|
|
472
472
|
|
|
473
|
-
return self._daemon.register_env(name, python
|
|
473
|
+
return self._daemon.register_env(name, python)
|
|
474
474
|
|
|
475
475
|
def publish(
|
|
476
476
|
self,
|
|
@@ -6,6 +6,7 @@ import hashlib
|
|
|
6
6
|
import importlib.metadata
|
|
7
7
|
import sqlite3
|
|
8
8
|
import subprocess
|
|
9
|
+
import sys
|
|
9
10
|
from pathlib import Path
|
|
10
11
|
from typing import Any, Callable
|
|
11
12
|
from uuid import uuid4
|
|
@@ -30,9 +31,10 @@ from spl.daemon.storage_base import (
|
|
|
30
31
|
class EnvRepository(RepositoryBase):
|
|
31
32
|
"""Persist and query env aggregate records."""
|
|
32
33
|
|
|
33
|
-
def register_env(self, name: str, python: str) -> dict[str, Any]:
|
|
34
|
+
def register_env(self, name: str, python: str | None = None) -> dict[str, Any]:
|
|
34
35
|
"""Register or update a named Python interpreter."""
|
|
35
36
|
|
|
37
|
+
python = python or sys.executable
|
|
36
38
|
name = validate_name(name)
|
|
37
39
|
python_path = Path(python).expanduser().absolute()
|
|
38
40
|
if not python_path.exists():
|
|
@@ -28,7 +28,7 @@ def register_env_routes(
|
|
|
28
28
|
async def register_env() -> Any:
|
|
29
29
|
body = await context.read_json_body()
|
|
30
30
|
return json_response(
|
|
31
|
-
runtime.store.register_env(body["name"], body
|
|
31
|
+
runtime.store.register_env(body["name"], body.get("python")),
|
|
32
32
|
HTTPStatus.CREATED,
|
|
33
33
|
)
|
|
34
34
|
|
|
@@ -80,7 +80,7 @@ class RegistryStore:
|
|
|
80
80
|
def __exit__(self, *_: Any) -> None:
|
|
81
81
|
self.close()
|
|
82
82
|
|
|
83
|
-
def register_env(self, name: str, python: str) -> dict[str, Any]:
|
|
83
|
+
def register_env(self, name: str, python: str | None = None) -> dict[str, Any]:
|
|
84
84
|
return self.envs.register_env(name, python)
|
|
85
85
|
|
|
86
86
|
def list_envs(self) -> dict[str, Any]:
|
|
@@ -485,13 +485,16 @@ class Client:
|
|
|
485
485
|
f"/server/libraries/{quote(library_ref)}/entries/{quote(name)}",
|
|
486
486
|
)
|
|
487
487
|
|
|
488
|
-
def register_env(self, name: str, python: str) -> dict[str, Any]:
|
|
488
|
+
def register_env(self, name: str, python: str | None = None) -> dict[str, Any]:
|
|
489
489
|
"""Register a Python executable as a daemon environment."""
|
|
490
490
|
|
|
491
|
+
payload = {"name": name}
|
|
492
|
+
if python is not None:
|
|
493
|
+
payload["python"] = python
|
|
491
494
|
return self._json_request(
|
|
492
495
|
"POST",
|
|
493
496
|
"/envs",
|
|
494
|
-
|
|
497
|
+
payload,
|
|
495
498
|
)
|
|
496
499
|
|
|
497
500
|
def list_envs(self) -> dict[str, Any]:
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|