datashare-python 0.8.8__py3-none-any.whl → 0.8.10__py3-none-any.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.
@@ -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
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datashare-python
3
- Version: 0.8.8
3
+ Version: 0.8.10
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/
@@ -5,7 +5,7 @@ datashare_python/config.py,sha256=kgrj--t8aH4TKQpcak6f8H5Zny13LwPwvFDJDQk5K10,41
5
5
  datashare_python/conftest.py,sha256=SiAVEwK5odlDljwyQMDxHlD-WEIem7oR04wAEoNH6jA,8673
6
6
  datashare_python/constants.py,sha256=a8-ceZKBVMXydcoNQ35fSjFjxeJ7dt-N6eAvqtPpf9g,320
7
7
  datashare_python/dependencies.py,sha256=5aM6v_WUfIn6SmYMEECh8os1aZOJjuOOCIuk-Y7a6Ak,4139
8
- datashare_python/discovery.py,sha256=d8fpY9AUSH7WP6600TTmm1Cjr1TKOYBoO50cN61dPdU,6999
8
+ datashare_python/discovery.py,sha256=dKCZFTa3R-Weg4LL39wL85vstsol6tTh3g0jbpeOh4E,7122
9
9
  datashare_python/exceptions.py,sha256=bVHEAXxDPKfxeeMC0hJXEsrJkgsKO2ESAhxWU96GA4M,496
10
10
  datashare_python/interceptors.py,sha256=Pl7GodPO4KbfflmacpW-vOUgLazjlXSlDNENbpOUt1c,6725
11
11
  datashare_python/logging_.py,sha256=XUnZ0LB6pfuijvmAlWboDuAf4Itf-qluT7W8k4tadkM,4617
@@ -14,14 +14,14 @@ datashare_python/task_client.py,sha256=oTmP8bvZW0UyhLNMi1AV3XIAx7hrdbxNRss2Mw2az
14
14
  datashare_python/template.py,sha256=RxKTYLXoS_EQ8Jc41JkBXppPdbCFqDWfP3BmC0gvB5o,4024
15
15
  datashare_python/types_.py,sha256=9Hk1XqpdXbM1TnEzwvJ5G9ABbaCZW9KgBTtiPBVn_7k,649
16
16
  datashare_python/utils.py,sha256=gX3_RJEJS0sAYBNVfBLoWJu7_hIANhylSAohzXVW-yQ,17982
17
- datashare_python/worker-template.tar.gz,sha256=udqMlgeKohpP9Chh9CmWKWcTw9Ie-IY8O8XVJ87ktfQ,286928
17
+ datashare_python/worker-template.tar.gz,sha256=dDOvNI_icE3ADXIXtkWbbKyEsE7gRzkMzmoWzFGZXOA,286934
18
18
  datashare_python/worker.py,sha256=czrN9Z0fPFX-6KHinX8Orx4vb9tpta2e7Qs6H0NiYyE,7534
19
19
  datashare_python/cli/__init__.py,sha256=9BPWtssDgsVfWMsZ1TtZCla0EC_kai4RHttr8oNLYOE,1401
20
20
  datashare_python/cli/project.py,sha256=w32Gy9AOL5B00uDT4in7YUCt2g68FnNbvwg2M3a8G6o,946
21
21
  datashare_python/cli/task.py,sha256=8mvKGS21bZ14BgZ0Uo-dfameljkaI2ZBha80ywCy-E8,5822
22
22
  datashare_python/cli/utils.py,sha256=p69CQb0zfixuyBkiZprhdMCc_NuYwXyAn6vC9H1UzAw,911
23
- datashare_python/cli/worker.py,sha256=KbWO6rqBpPPtgAVQpeZwu98JT3vQmrYl2NBt6OhS2WA,5388
24
- datashare_python-0.8.8.dist-info/METADATA,sha256=KODONhezJ_XKKFOVlNZx5jjAQ5aQz9TJVgjiit4g1pQ,929
25
- datashare_python-0.8.8.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
26
- datashare_python-0.8.8.dist-info/entry_points.txt,sha256=ILE7auxabHWiu3GC-AunWnzjhOI_SbZp7D4GqZHlLw4,68
27
- datashare_python-0.8.8.dist-info/RECORD,,
23
+ datashare_python/cli/worker.py,sha256=eIMgUatSmpQpeu0MSMMKBrmx3GWm_eQ-aLfVrgl513o,5773
24
+ datashare_python-0.8.10.dist-info/METADATA,sha256=HmzZjB3y6TTn6saRr2ODbPx5rlU6ZuDuNt9PBEzY-KE,930
25
+ datashare_python-0.8.10.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
26
+ datashare_python-0.8.10.dist-info/entry_points.txt,sha256=ILE7auxabHWiu3GC-AunWnzjhOI_SbZp7D4GqZHlLw4,68
27
+ datashare_python-0.8.10.dist-info/RECORD,,