datashare-python 0.2.25__py3-none-any.whl → 0.2.26__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.
@@ -75,9 +75,13 @@ to the documentation to learn how to do so."""
75
75
 
76
76
  @worker_app.async_command(help=_START_WORKER_HELP)
77
77
  async def start(
78
- workflows: Annotated[list[str], typer.Option(help=_START_WORKER_WORKFLOWS_HELP)],
79
- activities: Annotated[list[str], typer.Option(help=_START_WORKER_ACTIVITIES_HELP)],
80
78
  queue: Annotated[str, typer.Option("--queue", "-q", help=_WORKER_QUEUE_HELP)],
79
+ workflows: Annotated[
80
+ list[str] | None, typer.Option(help=_START_WORKER_WORKFLOWS_HELP)
81
+ ] = None,
82
+ activities: Annotated[
83
+ list[str] | None, typer.Option(help=_START_WORKER_ACTIVITIES_HELP)
84
+ ] = None,
81
85
  dependencies: Annotated[
82
86
  str | None, typer.Option(help=_START_WORKER_DEPS_HELP)
83
87
  ] = None,
@@ -105,6 +109,9 @@ async def start(
105
109
  )
106
110
  else:
107
111
  bootstrap_config = WorkerConfig()
112
+ logger.info(
113
+ "starting worker with config: %s", bootstrap_config.model_dump_json(indent=2)
114
+ )
108
115
  temporal_override = dict()
109
116
  if temporal_address is not None:
110
117
  temporal_override["host"] = temporal_address
@@ -54,8 +54,15 @@ def discover(
54
54
  f" {', '.join(act_names)}"
55
55
  )
56
56
  if not acts and not wfs:
57
- raise ValueError("Couldn't find any registered activity or workflow.")
58
- deps = discover_dependencies(deps_name)
57
+ msg = "Couldn't find any registered activity nor workflow matching "
58
+ if wf_names:
59
+ msg += "workflow patterns " + ", ".join(wf_names) + " "
60
+ if act_names:
61
+ msg = "activity patterns " + ", ".join(act_names)
62
+ raise ValueError(msg)
63
+ deps = None
64
+ if deps_name is not None:
65
+ deps = discover_dependencies(deps_name)
59
66
  if deps:
60
67
  n_deps = len(deps)
61
68
  discovered += "\n"
@@ -100,11 +107,9 @@ def discover_activities(names: list[str]) -> list[_RegisteredActivity]:
100
107
  return registered
101
108
 
102
109
 
103
- def discover_dependencies(name: str | None) -> _Dependencies | None:
110
+ def discover_dependencies(name: str) -> _Dependencies:
104
111
  impls = entry_points(name=_DEPENDENCIES, group=_DEPENDENCIES_GROUPS)
105
112
  if not impls:
106
- if name is None:
107
- return None
108
113
  available_impls = entry_points(group=_DEPENDENCIES_GROUPS)
109
114
  msg = (
110
115
  f'failed to find dependency: "{name}", '
@@ -115,26 +120,15 @@ def discover_dependencies(name: str | None) -> _Dependencies | None:
115
120
  msg = f'found multiple dependencies for name "{name}": {impls}'
116
121
  raise ValueError(msg)
117
122
  deps_registry = impls[_DEPENDENCIES].load()
118
- if name:
119
- try:
120
- return deps_registry[name]
121
- except KeyError as e:
122
- available = list(deps_registry)
123
- msg = (
124
- f'failed to find dependency for name "{name}", available dependencies: '
125
- f"{available}"
126
- )
127
- raise LookupError(msg) from e
128
- if not deps_registry:
129
- raise ValueError("empty dependency registry !")
130
- if len(deps_registry) > 1:
131
- available = ", ".join('"' + d + '"' for d in deps_registry)
123
+ try:
124
+ return deps_registry[name]
125
+ except KeyError as e:
126
+ available = list(deps_registry)
132
127
  msg = (
133
- f"dependency registry contains multiples entries {available},"
134
- f" please select one by providing a name"
128
+ f'failed to find dependency for name "{name}", available dependencies: '
129
+ f"{available}"
135
130
  )
136
- raise ValueError(msg)
137
- return next(iter(deps_registry.values()))
131
+ raise LookupError(msg) from e
138
132
 
139
133
 
140
134
  def _parse_wf_name(wf_type: type) -> str:
@@ -61,6 +61,7 @@ def init_project(name: str, path: Path) -> None:
61
61
  pyproject_toml = tomlkit.loads(pyproject_toml_path.read_text())
62
62
  pyproject_toml = _update_pyproject_toml(pyproject_toml, package_name=package_name)
63
63
  pyproject_toml_path.write_text(tomlkit.dumps(pyproject_toml))
64
+ raise NotImplementedError("implement entry point and dockerfile init")
64
65
 
65
66
 
66
67
  _BASE_DEPS = {"datashare-python", "icij-common", "temporalio"}
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datashare-python
3
- Version: 0.2.25
3
+ Version: 0.2.26
4
4
  Summary: Manage Pythoœn 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/
@@ -10,7 +10,6 @@ Author-email: Clément Doumouro <cdoumouro@icij.org>, Clément Doumouro <clement
10
10
  Requires-Python: <4,>=3.11
11
11
  Requires-Dist: aiohttp~=3.11.9
12
12
  Requires-Dist: alive-progress~=3.2.0
13
- Requires-Dist: datashare-worker-template[ml]~=0.1
14
13
  Requires-Dist: hatchling~=1.27.0
15
14
  Requires-Dist: icij-common[elasticsearch]~=0.8.2
16
15
  Requires-Dist: nest-asyncio~=1.6.0
@@ -5,23 +5,23 @@ datashare_python/config.py,sha256=u6iyOeSXzIO30Yja8Vj9LjM-cq8ESRBy3Kse6UadAMg,37
5
5
  datashare_python/conftest.py,sha256=BdRLjy9eJtxAKLDCcon1Nyhzn54CIw2z4s3ZOupNYGo,8256
6
6
  datashare_python/constants.py,sha256=e6Px11OUee9GSHwTgsgFMszGCMwpW-OznHSMgINvepc,338
7
7
  datashare_python/dependencies.py,sha256=Diu7alKGaFWyC_ajp0fKU-xp8u5f_8x1axAHVBlppD0,3707
8
- datashare_python/discovery.py,sha256=R0wws-_QgiK3GyTSf3p2UV41Ok-iuKeZauh6EJAdzGc,6401
8
+ datashare_python/discovery.py,sha256=khWTm11NlMVkRyxPV1lJimcTTicuVdxWHOC4H6PfFwE,6128
9
9
  datashare_python/exceptions.py,sha256=bVHEAXxDPKfxeeMC0hJXEsrJkgsKO2ESAhxWU96GA4M,496
10
10
  datashare_python/local_client.py,sha256=GP9MTcHVQ1mcb2eO6TiQ7mzQdx199lZRhK8DRuJqJVQ,2359
11
11
  datashare_python/objects.py,sha256=GMi2hlKuWFbWWoC2r8ITQGQcMsobHHChGvm4ZfIjMl0,4537
12
12
  datashare_python/task_client.py,sha256=oTmP8bvZW0UyhLNMi1AV3XIAx7hrdbxNRss2Mw2azEc,8435
13
- datashare_python/template.py,sha256=RxKTYLXoS_EQ8Jc41JkBXppPdbCFqDWfP3BmC0gvB5o,4024
13
+ datashare_python/template.py,sha256=fiDBKstNf-FdpdlvCzfsKhaLPLoQs6T6NQUlT6SwgYs,4099
14
14
  datashare_python/types_.py,sha256=9Hk1XqpdXbM1TnEzwvJ5G9ABbaCZW9KgBTtiPBVn_7k,649
15
15
  datashare_python/utils.py,sha256=DQt-rBwC3Ok72u8VyerG3rqwUTx3ftLfPdMQ5cnRrgs,16801
16
- datashare_python/worker-template.tar.gz,sha256=CTokaLmqZZ6tJPGT4N7YG9aDsP66yS1HvJN-IzWhh0c,142348
16
+ datashare_python/worker-template.tar.gz,sha256=78e5rLmnsu3YB79FD-KJjORP5aJ0MMwZg19jx9TkH8s,142345
17
17
  datashare_python/worker.py,sha256=A4SnmDB4y0ck6Wp_UZWdsSOyTvW54Z2Bq76gxtp-_PE,6070
18
18
  datashare_python/cli/__init__.py,sha256=5MGSE_0SwlOiwbyPwsP8RIXlTBB2_GGP0zDg4l6UAIY,1479
19
19
  datashare_python/cli/local.py,sha256=S-7qMpSqzi0oMvu01TCFEb8tayEvpw4pXMdCszKEYtU,986
20
20
  datashare_python/cli/project.py,sha256=w32Gy9AOL5B00uDT4in7YUCt2g68FnNbvwg2M3a8G6o,946
21
21
  datashare_python/cli/task.py,sha256=9If5OC7loG4C4gWWl4iOeqPJ4GOLlCWXQfuNLUHORrQ,5860
22
22
  datashare_python/cli/utils.py,sha256=p69CQb0zfixuyBkiZprhdMCc_NuYwXyAn6vC9H1UzAw,911
23
- datashare_python/cli/worker.py,sha256=tJ2xj_TCyjZVh1Jlb_AknHEg8xn9Js90Vb39slew8t4,5160
24
- datashare_python-0.2.25.dist-info/METADATA,sha256=yIqCI2amsvCqNeKqnJ0RJtHUV1OnrUn7Lue5DgbYWk0,958
25
- datashare_python-0.2.25.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
26
- datashare_python-0.2.25.dist-info/entry_points.txt,sha256=ILE7auxabHWiu3GC-AunWnzjhOI_SbZp7D4GqZHlLw4,68
27
- datashare_python-0.2.25.dist-info/RECORD,,
23
+ datashare_python/cli/worker.py,sha256=Gp8uZUbRdBz7CmuMrR9B705YbLOnIFSO3nLjQQnFgiE,5325
24
+ datashare_python-0.2.26.dist-info/METADATA,sha256=0UgrH2IdGphlcdMbCyDgNE24GG9-_Vk2KV8BHUcVQ3E,908
25
+ datashare_python-0.2.26.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
26
+ datashare_python-0.2.26.dist-info/entry_points.txt,sha256=ILE7auxabHWiu3GC-AunWnzjhOI_SbZp7D4GqZHlLw4,68
27
+ datashare_python-0.2.26.dist-info/RECORD,,