cocoindex 0.2.4__cp311-abi3-win_amd64.whl → 0.2.6__cp311-abi3-win_amd64.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.
cocoindex/_engine.pyd CHANGED
Binary file
cocoindex/cli.py CHANGED
@@ -363,6 +363,13 @@ def drop(app_target: str | None, flow_name: tuple[str, ...], force: bool) -> Non
363
363
  default=False,
364
364
  help="Continuously watch changes from data sources and apply to the target index.",
365
365
  )
366
+ @click.option(
367
+ "--reexport",
368
+ is_flag=True,
369
+ show_default=True,
370
+ default=False,
371
+ help="Reexport to targets even if there's no change.",
372
+ )
366
373
  @click.option(
367
374
  "--setup",
368
375
  is_flag=True,
@@ -389,6 +396,7 @@ def drop(app_target: str | None, flow_name: tuple[str, ...], force: bool) -> Non
389
396
  def update(
390
397
  app_flow_specifier: str,
391
398
  live: bool,
399
+ reexport: bool,
392
400
  setup: bool, # pylint: disable=redefined-outer-name
393
401
  force: bool,
394
402
  quiet: bool,
@@ -408,7 +416,11 @@ def update(
408
416
  fg="yellow",
409
417
  )
410
418
 
411
- options = flow.FlowLiveUpdaterOptions(live_mode=live, print_stats=not quiet)
419
+ options = flow.FlowLiveUpdaterOptions(
420
+ live_mode=live,
421
+ reexport_targets=reexport,
422
+ print_stats=not quiet,
423
+ )
412
424
  if flow_name is None:
413
425
  if setup:
414
426
  _setup_flows(
cocoindex/flow.py CHANGED
@@ -563,9 +563,14 @@ class FlowBuilder:
563
563
  class FlowLiveUpdaterOptions:
564
564
  """
565
565
  Options for live updating a flow.
566
+
567
+ - live_mode: Whether to perform live update for data sources with change capture mechanisms.
568
+ - reexport_targets: Whether to reexport to targets even if there's no change.
569
+ - print_stats: Whether to print stats during update.
566
570
  """
567
571
 
568
572
  live_mode: bool = True
573
+ reexport_targets: bool = False
569
574
  print_stats: bool = False
570
575
 
571
576
 
@@ -759,20 +764,25 @@ class Flow:
759
764
  """
760
765
  return self._full_name
761
766
 
762
- def update(self) -> _engine.IndexUpdateInfo:
767
+ def update(self, /, *, reexport_targets: bool = False) -> _engine.IndexUpdateInfo:
763
768
  """
764
769
  Update the index defined by the flow.
765
770
  Once the function returns, the index is fresh up to the moment when the function is called.
766
771
  """
767
- return execution_context.run(self.update_async())
772
+ return execution_context.run(
773
+ self.update_async(reexport_targets=reexport_targets)
774
+ )
768
775
 
769
- async def update_async(self) -> _engine.IndexUpdateInfo:
776
+ async def update_async(
777
+ self, /, *, reexport_targets: bool = False
778
+ ) -> _engine.IndexUpdateInfo:
770
779
  """
771
780
  Update the index defined by the flow.
772
781
  Once the function returns, the index is fresh up to the moment when the function is called.
773
782
  """
774
783
  async with FlowLiveUpdater(
775
- self, FlowLiveUpdaterOptions(live_mode=False)
784
+ self,
785
+ FlowLiveUpdaterOptions(live_mode=False, reexport_targets=reexport_targets),
776
786
  ) as updater:
777
787
  await updater.wait_async()
778
788
  return updater.update_stats()
@@ -152,6 +152,16 @@ def _start_parent_watchdog(
152
152
 
153
153
 
154
154
  def _subprocess_init(user_apps: list[str], parent_pid: int) -> None:
155
+ import signal
156
+ import faulthandler
157
+
158
+ faulthandler.enable()
159
+ # Ignore SIGINT in the subprocess on best-effort basis.
160
+ try:
161
+ signal.signal(signal.SIGINT, signal.SIG_IGN)
162
+ except Exception:
163
+ pass
164
+
155
165
  _start_parent_watchdog(parent_pid)
156
166
 
157
167
  # In case any user app is already in this subprocess, e.g. the subprocess is forked, we need to avoid loading it again.
@@ -193,10 +203,15 @@ _SUBPROC_EXECUTORS: dict[bytes, _ExecutorEntry] = {}
193
203
 
194
204
  def _call_method(method: Callable[..., Any], *args: Any, **kwargs: Any) -> Any:
195
205
  """Run an awaitable/coroutine to completion synchronously, otherwise return as-is."""
196
- if asyncio.iscoroutinefunction(method):
197
- return asyncio.run(method(*args, **kwargs))
198
- else:
199
- return method(*args, **kwargs)
206
+ try:
207
+ if asyncio.iscoroutinefunction(method):
208
+ return asyncio.run(method(*args, **kwargs))
209
+ else:
210
+ return method(*args, **kwargs)
211
+ except Exception as e:
212
+ raise RuntimeError(
213
+ f"Error calling method `{method.__name__}` from subprocess"
214
+ ) from e
200
215
 
201
216
 
202
217
  def _get_or_create_entry(key_bytes: bytes) -> _ExecutorEntry:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cocoindex
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: License :: OSI Approved :: Apache Software License
6
6
  Classifier: Operating System :: OS Independent
@@ -34,7 +34,7 @@ Provides-Extra: dev
34
34
  Provides-Extra: embeddings
35
35
  Provides-Extra: colpali
36
36
  Provides-Extra: all
37
- License-File: LICENSE
37
+ License-File: THIRD_PARTY_NOTICES.html
38
38
  Summary: With CocoIndex, users declare the transformation, CocoIndex creates & maintains an index, and keeps the derived index up to date based on source update, with minimal computation and changes.
39
39
  Keywords: indexing,real-time,incremental,pipeline,search,ai,etl,rag,dataflow,context-engineering
40
40
  Author-email: CocoIndex <cocoindex.io@gmail.com>
@@ -1,13 +1,13 @@
1
- cocoindex-0.2.4.dist-info/METADATA,sha256=ZDuF7kgiT_RMXpM5Yj5Rx7c0ZHQ-s3jagvX2vKiuxlk,13168
2
- cocoindex-0.2.4.dist-info/WHEEL,sha256=8hEf8NzM1FnmM77AjVt5h8nDuYkN3UqZ79LoIAHXeRE,95
3
- cocoindex-0.2.4.dist-info/entry_points.txt,sha256=_NretjYVzBdNTn7dK-zgwr7YfG2afz1u1uSE-5bZXF8,46
4
- cocoindex-0.2.4.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
1
+ cocoindex-0.2.6.dist-info/METADATA,sha256=SBjlFIiC3Un5UxiyoQPRQGlg1rnzKZJV9b-Qfcw1WL8,13185
2
+ cocoindex-0.2.6.dist-info/WHEEL,sha256=8hEf8NzM1FnmM77AjVt5h8nDuYkN3UqZ79LoIAHXeRE,95
3
+ cocoindex-0.2.6.dist-info/entry_points.txt,sha256=_NretjYVzBdNTn7dK-zgwr7YfG2afz1u1uSE-5bZXF8,46
4
+ cocoindex-0.2.6.dist-info/licenses/THIRD_PARTY_NOTICES.html,sha256=ihni2G0h2JAjyQAZ2stGGAIHtsK-VaoXoaD-6YCSPsM,716358
5
5
  cocoindex/__init__.py,sha256=5zwuS_X-n7QAE5uBSufqXp77OW8KVVD8E5t_6koDLRc,2293
6
- cocoindex/_engine.pyd,sha256=wN-7h4LBylHcv8Mej8yFo4OK7oS6rEpfwDrh3-LfMSM,71829504
6
+ cocoindex/_engine.pyd,sha256=oBPfMTcn9Il5ZKsQIykKLgcDGChbpu2GcDQ25ekib7A,71919104
7
7
  cocoindex/auth_registry.py,sha256=Qq1IVZb-7K4luRrQSDlOPbISnGEZ4kIDsrCU8H2ARw0,1529
8
- cocoindex/cli.py,sha256=JwPVE-Vdk0BetKZREPoLpBiX48IlmbmZ6oJ57wCmyok,21835
8
+ cocoindex/cli.py,sha256=KYCTkFQqEh7VdC72xlVal5eaiZM-vpAY1F3WOoG4Vro,22079
9
9
  cocoindex/convert.py,sha256=iKVufQXjsrvS8psKKZZYxuLohJvBIVctgKaRLLt8jK0,22711
10
- cocoindex/flow.py,sha256=YGSASrMNtQzX9S42XfOpspEBFayj16OiD3q5bTz1y98,38409
10
+ cocoindex/flow.py,sha256=ONJeZpgEU1REsJkpwmW6WU66kUZUN-ZCP4sxv_ILPcM,38884
11
11
  cocoindex/functions.py,sha256=CtiwTVW6g4BtO5_EvVcij7Si4Bx-axnM1hsdU43aM4g,12617
12
12
  cocoindex/index.py,sha256=GrqTm1rLwICQ8hadtNvJAxVg7GWMvtMmFcbiNtNzmP0,569
13
13
  cocoindex/lib.py,sha256=cZosix4nwROvod4QJOwCzrm6U1CVy_wKMMk7sDDG_Z0,849
@@ -18,7 +18,7 @@ cocoindex/runtime.py,sha256=6mE-jR1Kh5c4GETDvBgwjXZq69TK5rh1qNpaseRDZnw,1117
18
18
  cocoindex/setting.py,sha256=obq1EiFlSJvidQZPVVC9V5ZUZAzYnyYcSm_6XUVDkUE,5463
19
19
  cocoindex/setup.py,sha256=KbJvmeFu0NbeoH-5iDmHZP86f26HIId8kHmGUNZAePI,3160
20
20
  cocoindex/sources.py,sha256=Ij8LyYbM49zjPg-pJHMbas8sdLquEcgvmuYfv7wCdjI,3290
21
- cocoindex/subprocess_exec.py,sha256=my8PJ8J5U3ECQYoaiVQoiipxOCfxFa-czYjo_hOh0UE,9702
21
+ cocoindex/subprocess_exec.py,sha256=Fex5b6-OwtYkJ1lTZqSfG-23_k6jm0liGgEZD88f7O8,10113
22
22
  cocoindex/targets.py,sha256=7FfG9kuEf5KTXtLwXMFaPFIut3PsIbpb3XIEjjeF7Bg,2931
23
23
  cocoindex/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
24
  cocoindex/tests/conftest.py,sha256=Ih-rHazFUaIx4bcQ5_D4mHvLNWF7NB1yksiMUnDJCEg,1092
@@ -31,4 +31,4 @@ cocoindex/typing.py,sha256=bkKcp4G_xQODwQn92sfeNi-kXSWnbtlwTpFbrMGCnj4,14673
31
31
  cocoindex/user_app_loader.py,sha256=ZkvUG9aJNNECAjwTY0ZYtNpFd9dNBPVoPKGTtB7dSZg,1926
32
32
  cocoindex/utils.py,sha256=U3W39zD2uZpXX8v84tJD7sRmbC5ar3z_ljAP1cJrYXI,618
33
33
  cocoindex/validation.py,sha256=4ZjsW-SZT8X_TEEhEE6QG6D-8Oq_TkPAhTqP0mdFYSE,3194
34
- cocoindex-0.2.4.dist-info/RECORD,,
34
+ cocoindex-0.2.6.dist-info/RECORD,,