cocoindex 0.2.6__cp311-abi3-win_amd64.whl → 0.2.8__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
@@ -531,6 +531,13 @@ def evaluate(
531
531
  default=False,
532
532
  help="Automatically setup backends for the flow if it's not setup yet.",
533
533
  )
534
+ @click.option(
535
+ "--reexport",
536
+ is_flag=True,
537
+ show_default=True,
538
+ default=False,
539
+ help="Reexport to targets even if there's no change.",
540
+ )
534
541
  @click.option(
535
542
  "-f",
536
543
  "--force",
@@ -560,6 +567,7 @@ def server(
560
567
  address: str | None,
561
568
  live_update: bool,
562
569
  setup: bool, # pylint: disable=redefined-outer-name
570
+ reexport: bool,
563
571
  force: bool,
564
572
  quiet: bool,
565
573
  cors_origin: str | None,
@@ -583,6 +591,7 @@ def server(
583
591
  cors_local,
584
592
  live_update,
585
593
  setup,
594
+ reexport,
586
595
  force,
587
596
  quiet,
588
597
  )
@@ -631,6 +640,7 @@ def _run_server(
631
640
  cors_local: int | None = None,
632
641
  live_update: bool = False,
633
642
  run_setup: bool = False,
643
+ reexport: bool = False,
634
644
  force: bool = False,
635
645
  quiet: bool = False,
636
646
  ) -> None:
@@ -664,8 +674,12 @@ def _run_server(
664
674
 
665
675
  click.secho("Press Ctrl+C to stop the server.", fg="yellow")
666
676
 
667
- if live_update:
668
- options = flow.FlowLiveUpdaterOptions(live_mode=True, print_stats=not quiet)
677
+ if live_update or reexport:
678
+ options = flow.FlowLiveUpdaterOptions(
679
+ live_mode=live_update,
680
+ reexport_targets=reexport,
681
+ print_stats=not quiet,
682
+ )
669
683
  asyncio.run_coroutine_threadsafe(
670
684
  _update_all_flows_with_hint_async(options), execution_context.event_loop
671
685
  )
@@ -134,18 +134,27 @@ def _start_parent_watchdog(
134
134
  This runs in a background daemon thread so it never blocks pool work.
135
135
  """
136
136
 
137
+ import psutil # type: ignore
138
+
139
+ if parent_pid is None:
140
+ parent_pid = os.getppid()
141
+
142
+ try:
143
+ p = psutil.Process(parent_pid)
144
+ # Cache create_time to defeat PID reuse.
145
+ created = p.create_time()
146
+ except psutil.Error:
147
+ # Parent already gone or not accessible
148
+ os._exit(1)
149
+
137
150
  def _watch() -> None:
138
151
  while True:
139
- # If PPID changed (parent died and we were reparented), exit.
140
- if os.getppid() != parent_pid:
141
- os._exit(1)
142
-
143
- # Best-effort liveness probe in case PPID was reused.
144
152
  try:
145
- os.kill(parent_pid, 0)
146
- except OSError:
153
+ # is_running() + same create_time => same process and still alive
154
+ if not (p.is_running() and p.create_time() == created):
155
+ os._exit(1)
156
+ except psutil.NoSuchProcess:
147
157
  os._exit(1)
148
-
149
158
  time.sleep(interval_seconds)
150
159
 
151
160
  threading.Thread(target=_watch, name="parent-watchdog", daemon=True).start()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cocoindex
3
- Version: 0.2.6
3
+ Version: 0.2.8
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: License :: OSI Approved :: Apache Software License
6
6
  Classifier: Operating System :: OS Independent
@@ -21,6 +21,7 @@ Requires-Dist: rich>=14.0.0
21
21
  Requires-Dist: python-dotenv>=1.1.0
22
22
  Requires-Dist: watchfiles>=1.1.0
23
23
  Requires-Dist: numpy>=1.23.2
24
+ Requires-Dist: psutil>=7.0.0
24
25
  Requires-Dist: pytest ; extra == 'dev'
25
26
  Requires-Dist: pytest-asyncio ; extra == 'dev'
26
27
  Requires-Dist: ruff ; extra == 'dev'
@@ -1,11 +1,11 @@
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
1
+ cocoindex-0.2.8.dist-info/METADATA,sha256=C8Qlc66M8urf_SBkiljyRoh5aQhoxvAwREZtGyS96AI,13214
2
+ cocoindex-0.2.8.dist-info/WHEEL,sha256=8hEf8NzM1FnmM77AjVt5h8nDuYkN3UqZ79LoIAHXeRE,95
3
+ cocoindex-0.2.8.dist-info/entry_points.txt,sha256=_NretjYVzBdNTn7dK-zgwr7YfG2afz1u1uSE-5bZXF8,46
4
+ cocoindex-0.2.8.dist-info/licenses/THIRD_PARTY_NOTICES.html,sha256=bIwlpnm2Z7UZPtuCEf1LvTuA5PwmYwE2KvETfYMzFu8,716358
5
5
  cocoindex/__init__.py,sha256=5zwuS_X-n7QAE5uBSufqXp77OW8KVVD8E5t_6koDLRc,2293
6
- cocoindex/_engine.pyd,sha256=oBPfMTcn9Il5ZKsQIykKLgcDGChbpu2GcDQ25ekib7A,71919104
6
+ cocoindex/_engine.pyd,sha256=1eg4sfGuiw4pTgnwdIYmdyJBO0fSFJJthQpARiMAzRI,71919104
7
7
  cocoindex/auth_registry.py,sha256=Qq1IVZb-7K4luRrQSDlOPbISnGEZ4kIDsrCU8H2ARw0,1529
8
- cocoindex/cli.py,sha256=KYCTkFQqEh7VdC72xlVal5eaiZM-vpAY1F3WOoG4Vro,22079
8
+ cocoindex/cli.py,sha256=1oE-FIefiZ-wlL9P1p0AdHPfquonVYMl_v2aZ2o-eE4,22406
9
9
  cocoindex/convert.py,sha256=iKVufQXjsrvS8psKKZZYxuLohJvBIVctgKaRLLt8jK0,22711
10
10
  cocoindex/flow.py,sha256=ONJeZpgEU1REsJkpwmW6WU66kUZUN-ZCP4sxv_ILPcM,38884
11
11
  cocoindex/functions.py,sha256=CtiwTVW6g4BtO5_EvVcij7Si4Bx-axnM1hsdU43aM4g,12617
@@ -18,10 +18,9 @@ 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=Fex5b6-OwtYkJ1lTZqSfG-23_k6jm0liGgEZD88f7O8,10113
21
+ cocoindex/subprocess_exec.py,sha256=u_kF4C8dToPg-9a7NeFroR8pJCOFag_NT0icLe184QQ,10391
22
22
  cocoindex/targets.py,sha256=7FfG9kuEf5KTXtLwXMFaPFIut3PsIbpb3XIEjjeF7Bg,2931
23
23
  cocoindex/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
- cocoindex/tests/conftest.py,sha256=Ih-rHazFUaIx4bcQ5_D4mHvLNWF7NB1yksiMUnDJCEg,1092
25
24
  cocoindex/tests/test_convert.py,sha256=kngLt9p2BXo3D7_OZNnnSS1w_Ew8966IuaDpHcfd9Go,51750
26
25
  cocoindex/tests/test_optional_database.py,sha256=dnzmTgaJf37D3q8fQsjP5UDER6FYETaUokDnFBMLtIk,8755
27
26
  cocoindex/tests/test_transform_flow.py,sha256=DxM-7_kWeU-QzOpH77Vd5Jehbbq00xCBBgRK7mRn0kI,6237
@@ -31,4 +30,4 @@ cocoindex/typing.py,sha256=bkKcp4G_xQODwQn92sfeNi-kXSWnbtlwTpFbrMGCnj4,14673
31
30
  cocoindex/user_app_loader.py,sha256=ZkvUG9aJNNECAjwTY0ZYtNpFd9dNBPVoPKGTtB7dSZg,1926
32
31
  cocoindex/utils.py,sha256=U3W39zD2uZpXX8v84tJD7sRmbC5ar3z_ljAP1cJrYXI,618
33
32
  cocoindex/validation.py,sha256=4ZjsW-SZT8X_TEEhEE6QG6D-8Oq_TkPAhTqP0mdFYSE,3194
34
- cocoindex-0.2.6.dist-info/RECORD,,
33
+ cocoindex-0.2.8.dist-info/RECORD,,
@@ -2428,7 +2428,7 @@ Software.
2428
2428
  <h3 id="Apache-2.0">Apache License 2.0</h3>
2429
2429
  <h4>Used by:</h4>
2430
2430
  <ul class="license-used-by">
2431
- <li><a href=" https://crates.io/crates/cocoindex ">cocoindex 0.2.6</a></li>
2431
+ <li><a href=" https://crates.io/crates/cocoindex ">cocoindex 0.2.8</a></li>
2432
2432
  <li><a href=" https://github.com/awesomized/crc-fast-rust ">crc-fast 1.3.0</a></li>
2433
2433
  <li><a href=" https://github.com/qdrant/rust-client ">qdrant-client 1.15.0</a></li>
2434
2434
  </ul>
@@ -1,38 +0,0 @@
1
- import pytest
2
- import typing
3
- import os
4
- import signal
5
- import sys
6
-
7
-
8
- @pytest.fixture(scope="session", autouse=True)
9
- def _cocoindex_windows_env_fixture(
10
- request: pytest.FixtureRequest,
11
- ) -> typing.Generator[None, None, None]:
12
- """Shutdown the subprocess pool at exit on Windows."""
13
-
14
- yield
15
-
16
- if not sys.platform.startswith("win"):
17
- return
18
-
19
- try:
20
- import cocoindex.subprocess_exec
21
-
22
- original_sigint_handler = signal.getsignal(signal.SIGINT)
23
- try:
24
- signal.signal(signal.SIGINT, signal.SIG_IGN)
25
- cocoindex.subprocess_exec.shutdown_pool_at_exit()
26
-
27
- # If any test failed, let pytest exit normally with nonzero code
28
- if request.session.testsfailed == 0:
29
- os._exit(0) # immediate success exit (skips atexit/teardown)
30
-
31
- finally:
32
- try:
33
- signal.signal(signal.SIGINT, original_sigint_handler)
34
- except ValueError: # noqa: BLE001
35
- pass
36
-
37
- except (ImportError, AttributeError): # noqa: BLE001
38
- pass