datashare-python 0.8.9__tar.gz → 0.8.11__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 (28) hide show
  1. {datashare_python-0.8.9 → datashare_python-0.8.11}/PKG-INFO +1 -1
  2. {datashare_python-0.8.9 → datashare_python-0.8.11}/datashare_python/cli/worker.py +15 -1
  3. {datashare_python-0.8.9 → datashare_python-0.8.11}/datashare_python/discovery.py +9 -2
  4. datashare_python-0.8.11/datashare_python/worker-template.tar.gz +0 -0
  5. {datashare_python-0.8.9 → datashare_python-0.8.11}/pyproject.toml +1 -1
  6. datashare_python-0.8.9/datashare_python/worker-template.tar.gz +0 -0
  7. {datashare_python-0.8.9 → datashare_python-0.8.11}/.gitignore +0 -0
  8. {datashare_python-0.8.9 → datashare_python-0.8.11}/README.md +0 -0
  9. {datashare_python-0.8.9 → datashare_python-0.8.11}/datashare_python/.gitignore +0 -0
  10. {datashare_python-0.8.9 → datashare_python-0.8.11}/datashare_python/__init__.py +0 -0
  11. {datashare_python-0.8.9 → datashare_python-0.8.11}/datashare_python/__main__.py +0 -0
  12. {datashare_python-0.8.9 → datashare_python-0.8.11}/datashare_python/cli/__init__.py +0 -0
  13. {datashare_python-0.8.9 → datashare_python-0.8.11}/datashare_python/cli/project.py +0 -0
  14. {datashare_python-0.8.9 → datashare_python-0.8.11}/datashare_python/cli/task.py +0 -0
  15. {datashare_python-0.8.9 → datashare_python-0.8.11}/datashare_python/cli/utils.py +0 -0
  16. {datashare_python-0.8.9 → datashare_python-0.8.11}/datashare_python/config.py +0 -0
  17. {datashare_python-0.8.9 → datashare_python-0.8.11}/datashare_python/conftest.py +0 -0
  18. {datashare_python-0.8.9 → datashare_python-0.8.11}/datashare_python/constants.py +0 -0
  19. {datashare_python-0.8.9 → datashare_python-0.8.11}/datashare_python/dependencies.py +0 -0
  20. {datashare_python-0.8.9 → datashare_python-0.8.11}/datashare_python/exceptions.py +0 -0
  21. {datashare_python-0.8.9 → datashare_python-0.8.11}/datashare_python/interceptors.py +0 -0
  22. {datashare_python-0.8.9 → datashare_python-0.8.11}/datashare_python/logging_.py +0 -0
  23. {datashare_python-0.8.9 → datashare_python-0.8.11}/datashare_python/objects.py +0 -0
  24. {datashare_python-0.8.9 → datashare_python-0.8.11}/datashare_python/task_client.py +0 -0
  25. {datashare_python-0.8.9 → datashare_python-0.8.11}/datashare_python/template.py +0 -0
  26. {datashare_python-0.8.9 → datashare_python-0.8.11}/datashare_python/types_.py +0 -0
  27. {datashare_python-0.8.9 → datashare_python-0.8.11}/datashare_python/utils.py +0 -0
  28. {datashare_python-0.8.9 → datashare_python-0.8.11}/datashare_python/worker.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datashare-python
3
- Version: 0.8.9
3
+ Version: 0.8.11
4
4
  Summary: Manage Python tasks and local resources in Datashare
5
5
  Project-URL: Homepage, https://icij.github.io/datashare-python/
6
6
  Project-URL: Documentation, https://icij.github.io/datashare-python/
@@ -29,6 +29,10 @@ _START_WORKER_CONFIG_PATH_HELP = (
29
29
  "path to a worker config YAML file,"
30
30
  " if not provided will load worker configuration from env variables"
31
31
  )
32
+ _START_WORKER_SKIP_CONFIG_CLS_DISCOVERY = (
33
+ "skip config class discovery (useful to run a workflow worker from different app)"
34
+ )
35
+
32
36
  _WORKER_QUEUE_HELP = "worker task queue"
33
37
  _TEMPORAL_NAMESPACE_HELP = "worker temporal namespace"
34
38
 
@@ -105,9 +109,19 @@ async def start(
105
109
  str | None,
106
110
  typer.Option("--temporal-namespace", "-ns", help=_TEMPORAL_NAMESPACE_HELP),
107
111
  ] = None,
112
+ *,
113
+ skip_config_discovery: Annotated[
114
+ bool,
115
+ typer.Option(
116
+ "--skip-config-discovery", help=_START_WORKER_SKIP_CONFIG_CLS_DISCOVERY
117
+ ),
118
+ ] = False,
108
119
  ) -> None:
109
120
  registered_wfs, registered_acts, registered_deps, worker_config_cls = discover(
110
- workflows, act_names=activities, deps_name=dependencies
121
+ workflows,
122
+ act_names=activities,
123
+ deps_name=dependencies,
124
+ skip_config=skip_config_discovery,
111
125
  )
112
126
  if config_path is not None:
113
127
  with config_path.open() as f:
@@ -33,7 +33,11 @@ _MANDATORY_DEPS = [set_worker_config, set_loggers]
33
33
 
34
34
 
35
35
  def discover(
36
- wf_names: list[str] | None, *, act_names: list[str] | None, deps_name: str | None
36
+ wf_names: list[str] | None,
37
+ *,
38
+ act_names: list[str] | None,
39
+ deps_name: str | None,
40
+ skip_config: bool = False,
37
41
  ) -> _Discovery:
38
42
  discovered = ""
39
43
  wfs = None
@@ -80,7 +84,10 @@ def discover(
80
84
  f"- {n_deps} dependenc{'ies' if n_deps > 1 else 'y'}:"
81
85
  f" {', '.join(deps_names)}"
82
86
  )
83
- worker_config_cls = discover_worker_config_cls()
87
+ if not skip_config:
88
+ worker_config_cls = discover_worker_config_cls()
89
+ else:
90
+ worker_config_cls = WorkerConfig
84
91
  discovered += f"- worker config class: {worker_config_cls}"
85
92
  logger.info("discovered:\n%s", discovered)
86
93
  return wfs, acts, deps, worker_config_cls
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "datashare-python"
3
- version = "0.8.9"
3
+ version = "0.8.11"
4
4
  description = "Manage Python tasks and local resources in Datashare"
5
5
  authors = [
6
6
  { name = "Clément Doumouro", email = "cdoumouro@icij.org" },