lakana-worker 0.12.0__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.
Files changed (97) hide show
  1. lakana_worker-0.12.0/.gitignore +25 -0
  2. lakana_worker-0.12.0/PKG-INFO +40 -0
  3. lakana_worker-0.12.0/README.md +11 -0
  4. lakana_worker-0.12.0/hatch_build.py +39 -0
  5. lakana_worker-0.12.0/pyproject.toml +58 -0
  6. lakana_worker-0.12.0/src/lakana_worker/__init__.py +1 -0
  7. lakana_worker-0.12.0/src/lakana_worker/__main__.py +547 -0
  8. lakana_worker-0.12.0/src/lakana_worker/activity.py +97 -0
  9. lakana_worker-0.12.0/src/lakana_worker/attempt_sweep.py +348 -0
  10. lakana_worker-0.12.0/src/lakana_worker/checks.py +171 -0
  11. lakana_worker-0.12.0/src/lakana_worker/deploy.py +789 -0
  12. lakana_worker-0.12.0/src/lakana_worker/deploy_sweep.py +231 -0
  13. lakana_worker-0.12.0/src/lakana_worker/egress.py +745 -0
  14. lakana_worker-0.12.0/src/lakana_worker/executor.py +902 -0
  15. lakana_worker-0.12.0/src/lakana_worker/git.py +1400 -0
  16. lakana_worker-0.12.0/src/lakana_worker/heartbeat.py +214 -0
  17. lakana_worker-0.12.0/src/lakana_worker/index_credentials.py +706 -0
  18. lakana_worker-0.12.0/src/lakana_worker/memory.py +1304 -0
  19. lakana_worker-0.12.0/src/lakana_worker/notify.py +758 -0
  20. lakana_worker-0.12.0/src/lakana_worker/pipeline.py +2707 -0
  21. lakana_worker-0.12.0/src/lakana_worker/poller.py +514 -0
  22. lakana_worker-0.12.0/src/lakana_worker/processes.py +511 -0
  23. lakana_worker-0.12.0/src/lakana_worker/python_support.py +107 -0
  24. lakana_worker-0.12.0/src/lakana_worker/python_tasks.py +1838 -0
  25. lakana_worker-0.12.0/src/lakana_worker/query_child.py +685 -0
  26. lakana_worker-0.12.0/src/lakana_worker/query_process.py +1007 -0
  27. lakana_worker-0.12.0/src/lakana_worker/query_protocol.py +426 -0
  28. lakana_worker-0.12.0/src/lakana_worker/runners.py +1133 -0
  29. lakana_worker-0.12.0/src/lakana_worker/scheduler.py +373 -0
  30. lakana_worker-0.12.0/src/lakana_worker/spill.py +169 -0
  31. lakana_worker-0.12.0/src/lakana_worker/task_checks.py +1591 -0
  32. lakana_worker-0.12.0/src/lakana_worker/task_integrity.py +98 -0
  33. lakana_worker-0.12.0/src/lakana_worker/task_lease.py +224 -0
  34. lakana_worker-0.12.0/src/lakana_worker/task_logs.py +85 -0
  35. lakana_worker-0.12.0/src/lakana_worker/task_outcome.py +203 -0
  36. lakana_worker-0.12.0/src/lakana_worker/tasks.py +1132 -0
  37. lakana_worker-0.12.0/src/lakana_worker/venvs.py +791 -0
  38. lakana_worker-0.12.0/tests/check_run_helpers.py +645 -0
  39. lakana_worker-0.12.0/tests/conftest.py +276 -0
  40. lakana_worker-0.12.0/tests/index_fixture.py +308 -0
  41. lakana_worker-0.12.0/tests/scripted_child.py +331 -0
  42. lakana_worker-0.12.0/tests/sshd/Dockerfile +10 -0
  43. lakana_worker-0.12.0/tests/task_run_helpers.py +464 -0
  44. lakana_worker-0.12.0/tests/test_artifact_manifest_parity.py +273 -0
  45. lakana_worker-0.12.0/tests/test_attempt_sweep.py +602 -0
  46. lakana_worker-0.12.0/tests/test_audit_log_lifecycle_integration.py +296 -0
  47. lakana_worker-0.12.0/tests/test_checks.py +939 -0
  48. lakana_worker-0.12.0/tests/test_deploy.py +2668 -0
  49. lakana_worker-0.12.0/tests/test_deploy_sweep.py +337 -0
  50. lakana_worker-0.12.0/tests/test_discovery_harness_parity.py +434 -0
  51. lakana_worker-0.12.0/tests/test_egress.py +850 -0
  52. lakana_worker-0.12.0/tests/test_executor.py +1617 -0
  53. lakana_worker-0.12.0/tests/test_git.py +2753 -0
  54. lakana_worker-0.12.0/tests/test_git_ssh_integration.py +152 -0
  55. lakana_worker-0.12.0/tests/test_harness_server_messages.py +46 -0
  56. lakana_worker-0.12.0/tests/test_hatch_build.py +53 -0
  57. lakana_worker-0.12.0/tests/test_heartbeat.py +324 -0
  58. lakana_worker-0.12.0/tests/test_index_credentials.py +946 -0
  59. lakana_worker-0.12.0/tests/test_main.py +1571 -0
  60. lakana_worker-0.12.0/tests/test_memory.py +1408 -0
  61. lakana_worker-0.12.0/tests/test_notify.py +1016 -0
  62. lakana_worker-0.12.0/tests/test_package.py +8 -0
  63. lakana_worker-0.12.0/tests/test_pipeline.py +3636 -0
  64. lakana_worker-0.12.0/tests/test_pipeline_check_rows.py +2826 -0
  65. lakana_worker-0.12.0/tests/test_pipeline_lockdown.py +437 -0
  66. lakana_worker-0.12.0/tests/test_pipeline_maintenance.py +222 -0
  67. lakana_worker-0.12.0/tests/test_pipeline_outcome.py +1846 -0
  68. lakana_worker-0.12.0/tests/test_pipeline_stored_text.py +227 -0
  69. lakana_worker-0.12.0/tests/test_pipeline_views.py +691 -0
  70. lakana_worker-0.12.0/tests/test_pipeline_writes.py +1628 -0
  71. lakana_worker-0.12.0/tests/test_policy_lifecycle_integration.py +212 -0
  72. lakana_worker-0.12.0/tests/test_poller.py +2168 -0
  73. lakana_worker-0.12.0/tests/test_processes.py +809 -0
  74. lakana_worker-0.12.0/tests/test_python_support.py +51 -0
  75. lakana_worker-0.12.0/tests/test_python_tasks.py +6626 -0
  76. lakana_worker-0.12.0/tests/test_query_child.py +1448 -0
  77. lakana_worker-0.12.0/tests/test_query_introspection.py +228 -0
  78. lakana_worker-0.12.0/tests/test_query_placeholders.py +191 -0
  79. lakana_worker-0.12.0/tests/test_query_process.py +1539 -0
  80. lakana_worker-0.12.0/tests/test_query_protocol.py +292 -0
  81. lakana_worker-0.12.0/tests/test_query_rewrite_execution.py +133 -0
  82. lakana_worker-0.12.0/tests/test_query_rewrite_policy_properties.py +154 -0
  83. lakana_worker-0.12.0/tests/test_runners.py +1847 -0
  84. lakana_worker-0.12.0/tests/test_scheduler.py +950 -0
  85. lakana_worker-0.12.0/tests/test_secrets_lifecycle_integration.py +192 -0
  86. lakana_worker-0.12.0/tests/test_spill.py +220 -0
  87. lakana_worker-0.12.0/tests/test_task_checks.py +1067 -0
  88. lakana_worker-0.12.0/tests/test_task_checks_claims.py +1777 -0
  89. lakana_worker-0.12.0/tests/test_task_checks_kept.py +1835 -0
  90. lakana_worker-0.12.0/tests/test_task_lease.py +248 -0
  91. lakana_worker-0.12.0/tests/test_task_memory.py +805 -0
  92. lakana_worker-0.12.0/tests/test_tasks.py +1980 -0
  93. lakana_worker-0.12.0/tests/test_venvs.py +1270 -0
  94. lakana_worker-0.12.0/tests/test_venvs_private_index.py +197 -0
  95. lakana_worker-0.12.0/tests/test_worker_lifecycle_integration.py +375 -0
  96. lakana_worker-0.12.0/tests/worker_git_helpers.py +458 -0
  97. lakana_worker-0.12.0/tests/worker_test_helpers.py +220 -0
@@ -0,0 +1,25 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ venv/
5
+ .env
6
+ *.egg-info/
7
+ dist/
8
+ build/
9
+ .pytest_cache/
10
+ .ruff_cache/
11
+ .mypy_cache/
12
+ .import_linter_cache/
13
+ .coverage
14
+ coverage.json
15
+ mutants/
16
+ htmlcov/
17
+ .DS_Store
18
+ node_modules/
19
+ .idea/
20
+ .vscode/
21
+ .superpowers/
22
+ docs/superpowers/
23
+ graphify-out/
24
+ .worktrees/
25
+ site-build/
@@ -0,0 +1,40 @@
1
+ Metadata-Version: 2.5
2
+ Name: lakana-worker
3
+ Version: 0.12.0
4
+ Summary: Lakana's DuckDB query executor and dequeue loop.
5
+ Project-URL: Homepage, https://github.com/chrschy/lakana
6
+ Project-URL: Documentation, https://github.com/chrschy/lakana/tree/main/docs/site
7
+ Project-URL: Repository, https://github.com/chrschy/lakana
8
+ Project-URL: Issues, https://github.com/chrschy/lakana/issues
9
+ Project-URL: Changelog, https://github.com/chrschy/lakana/blob/main/CHANGELOG.md
10
+ Author: Christopher Schymura
11
+ License-Expression: Apache-2.0
12
+ Keywords: data-platform,duckdb,iceberg,lakehouse
13
+ Classifier: Development Status :: 2 - Pre-Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Topic :: Database
24
+ Requires-Python: >=3.11
25
+ Requires-Dist: duckdb<2,>=1.1
26
+ Requires-Dist: httpx<1,>=0.28
27
+ Requires-Dist: lakana-core==0.12.0
28
+ Description-Content-Type: text/markdown
29
+
30
+ # lakana-worker
31
+
32
+ > **Pre-beta.** Lakana is published as a 0.x pre-beta: the API and the data layout may change
33
+ > between releases, and it is not ready for production data yet. See the
34
+ > [project README](https://github.com/chrschy/lakana#readme).
35
+
36
+ The DuckDB query executor and dequeue loop. The only Lakana package allowed to
37
+ import `duckdb`. Never imports `lakana-server`; the queue table (`query_runs`,
38
+ in `lakana-core`) is the only channel between the two.
39
+
40
+ Part of [Lakana](https://github.com/chrschy/lakana). Installed with `pip install "lakana[server]"`.
@@ -0,0 +1,11 @@
1
+ # lakana-worker
2
+
3
+ > **Pre-beta.** Lakana is published as a 0.x pre-beta: the API and the data layout may change
4
+ > between releases, and it is not ready for production data yet. See the
5
+ > [project README](https://github.com/chrschy/lakana#readme).
6
+
7
+ The DuckDB query executor and dequeue loop. The only Lakana package allowed to
8
+ import `duckdb`. Never imports `lakana-server`; the queue table (`query_runs`,
9
+ in `lakana-core`) is the only channel between the two.
10
+
11
+ Part of [Lakana](https://github.com/chrschy/lakana). Installed with `pip install "lakana[server]"`.
@@ -0,0 +1,39 @@
1
+ """Hatchling metadata hook: pin `lakana-core` to this exact release.
2
+
3
+ hatch-vcs resolves every workspace package's version from the same git tag
4
+ (`raw-options.root = "../.."` in each package's `[tool.hatch.version]`), so
5
+ `lakana-core` can be pinned to precisely this build's own version with no
6
+ hand-edited version anywhere (rule 3): hatchling resolves `project.version`
7
+ before any metadata hook's `update()` runs
8
+ (`hatchling.metadata.core.ProjectMetadata.core`), so `metadata["version"]`
9
+ below is already the real, resolved version. See
10
+ `packages/lakana/hatch_build.py`'s `ServerExtraMetadataHook`, which pins
11
+ `lakana-server`/`lakana-worker` inside `lakana`'s `server` extra the same way.
12
+
13
+ `dependencies` is dynamic in `pyproject.toml`, so hatchling requires this
14
+ hook to supply the *entire* list, not just the pinned addition. The other
15
+ dependencies, with their explanatory comments, live under this hook's own
16
+ config table (`[tool.hatch.metadata.hooks.custom]`) so they stay readable as
17
+ ordinary TOML instead of being hard-coded here.
18
+ """
19
+
20
+ from __future__ import annotations
21
+
22
+ from typing import Any
23
+
24
+ from hatchling.metadata.plugin.interface import MetadataHookInterface
25
+
26
+
27
+ class CoreDependencyMetadataHook(MetadataHookInterface):
28
+ """Appends a `lakana-core==<version>` pin to the configured dependencies."""
29
+
30
+ def update(self, metadata: dict[str, Any]) -> None:
31
+ """Set `dependencies` to the configured list plus a `lakana-core` pin.
32
+
33
+ Parameters
34
+ ----------
35
+ metadata
36
+ The `project` table, mutated in place.
37
+ """
38
+ version = metadata["version"]
39
+ metadata["dependencies"] = [*self.config["dependencies"], f"lakana-core=={version}"]
@@ -0,0 +1,58 @@
1
+ [build-system]
2
+ requires = ["hatchling", "hatch-vcs"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "lakana-worker"
7
+ description = "Lakana's DuckDB query executor and dequeue loop."
8
+ readme = "README.md"
9
+ requires-python = ">=3.11"
10
+ license = "Apache-2.0"
11
+ authors = [{ name = "Christopher Schymura" }]
12
+ keywords = ["lakehouse", "duckdb", "iceberg", "data-platform"]
13
+ classifiers = [
14
+ "Development Status :: 2 - Pre-Alpha",
15
+ "License :: OSI Approved :: Apache Software License",
16
+ "Intended Audience :: Developers",
17
+ "Operating System :: OS Independent",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3 :: Only",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: 3.13",
23
+ "Programming Language :: Python :: 3.14",
24
+ "Topic :: Database",
25
+ ]
26
+ urls = { Homepage = "https://github.com/chrschy/lakana", Documentation = "https://github.com/chrschy/lakana/tree/main/docs/site", Repository = "https://github.com/chrschy/lakana", Issues = "https://github.com/chrschy/lakana/issues", Changelog = "https://github.com/chrschy/lakana/blob/main/CHANGELOG.md" }
27
+ dynamic = ["version", "dependencies"]
28
+
29
+ [project.scripts]
30
+ lakana-worker = "lakana_worker.__main__:main"
31
+
32
+ [tool.uv.sources]
33
+ lakana-core = { workspace = true }
34
+
35
+ [tool.hatch.version]
36
+ source = "vcs"
37
+ raw-options = { root = "../.." }
38
+
39
+ [tool.hatch.metadata.hooks.custom]
40
+ # Loads `hatch_build.py`'s `CoreDependencyMetadataHook`, which appends
41
+ # `lakana-core==<this build's version>` to the `dependencies` list below,
42
+ # pinning lakana-worker to exactly this release's lakana-core -- the
43
+ # same hatch-vcs-resolved version pattern as `packages/lakana/hatch_build.py`'s
44
+ # `ServerExtraMetadataHook`. `dependencies` lives here, not under
45
+ # `[project]`, because hatchling requires the hook to supply the *entire*
46
+ # list once `dependencies` is dynamic; keeping the other pins and their
47
+ # comments in this table (rather than hard-coding them into hatch_build.py)
48
+ # keeps them visible and editable as ordinary TOML.
49
+ dependencies = [
50
+ # MIT. Capped below 2: on a DuckDB 2.0 development build, the tests of the
51
+ # query guard and of DuckDB's error texts fail. Lifted by issue #96.
52
+ "duckdb>=1.1,<2",
53
+ # BSD-3-Clause. Sends webhooks (`egress.py`); the lakana SDK already depends on it.
54
+ "httpx>=0.28,<1",
55
+ ]
56
+
57
+ [tool.hatch.build.targets.wheel]
58
+ packages = ["src/lakana_worker"]
@@ -0,0 +1 @@
1
+ """Lakana's DuckDB query executor and dequeue loop."""