omdev 0.0.0.dev352__py3-none-any.whl → 0.0.0.dev353__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.

Potentially problematic release.


This version of omdev might be problematic. Click here for more details.

omdev/cli/install.py CHANGED
@@ -19,7 +19,7 @@ import typing as ta
19
19
 
20
20
 
21
21
  DEFAULT_CLI_PKG = 'omdev-cli'
22
- DEFAULT_PY_VER = '3.12'
22
+ DEFAULT_PY_VER = '3.13'
23
23
 
24
24
 
25
25
  @dc.dataclass(frozen=True)
omdev/scripts/ci.py CHANGED
@@ -9450,7 +9450,11 @@ class CoroHttpServer:
9450
9450
 
9451
9451
  #
9452
9452
 
9453
- def coro_handle(self) -> ta.Generator[Io, ta.Optional[bytes], None]:
9453
+ @dc.dataclass(frozen=True)
9454
+ class CoroHandleResult:
9455
+ close_reason: ta.Literal['response', 'internal', None] = None
9456
+
9457
+ def coro_handle(self) -> ta.Generator[Io, ta.Optional[bytes], CoroHandleResult]:
9454
9458
  return self._coro_run_handler(self._coro_handle_one())
9455
9459
 
9456
9460
  class Close(Exception): # noqa
@@ -9463,7 +9467,7 @@ class CoroHttpServer:
9463
9467
  ta.Optional[bytes],
9464
9468
  None,
9465
9469
  ],
9466
- ) -> ta.Generator[Io, ta.Optional[bytes], None]:
9470
+ ) -> ta.Generator[Io, ta.Optional[bytes], CoroHandleResult]:
9467
9471
  i: ta.Optional[bytes]
9468
9472
  o: ta.Any = next(gen)
9469
9473
  while True:
@@ -9487,7 +9491,9 @@ class CoroHttpServer:
9487
9491
 
9488
9492
  o.close()
9489
9493
  if o.close_connection:
9490
- break
9494
+ return self.CoroHandleResult(
9495
+ close_reason='response',
9496
+ )
9491
9497
  o = None
9492
9498
 
9493
9499
  else:
@@ -9496,9 +9502,11 @@ class CoroHttpServer:
9496
9502
  try:
9497
9503
  o = gen.send(i)
9498
9504
  except self.Close:
9499
- return
9505
+ return self.CoroHandleResult(
9506
+ close_reason='internal',
9507
+ )
9500
9508
  except StopIteration:
9501
- break
9509
+ return self.CoroHandleResult()
9502
9510
 
9503
9511
  except Exception: # noqa
9504
9512
  if hasattr(o, 'close'):
@@ -10813,16 +10821,32 @@ class CoroHttpServerSocketHandler(SocketHandler_):
10813
10821
  self,
10814
10822
  server_factory: CoroHttpServerFactory,
10815
10823
  *,
10824
+ keep_alive: bool = False,
10816
10825
  log_handler: ta.Optional[ta.Callable[[CoroHttpServer, CoroHttpServer.AnyLogIo], None]] = None,
10817
10826
  ) -> None:
10818
10827
  super().__init__()
10819
10828
 
10820
10829
  self._server_factory = server_factory
10830
+ self._keep_alive = keep_alive
10821
10831
  self._log_handler = log_handler
10822
10832
 
10823
10833
  def __call__(self, client_address: SocketAddress, fp: SocketIoPair) -> None:
10824
10834
  server = self._server_factory(client_address)
10825
10835
 
10836
+ if self._keep_alive:
10837
+ for i in itertools.count(): # noqa
10838
+ res = self._handle_one(server, fp)
10839
+ if res.close_reason is not None:
10840
+ break
10841
+
10842
+ else:
10843
+ self._handle_one(server, fp)
10844
+
10845
+ def _handle_one(
10846
+ self,
10847
+ server: CoroHttpServer,
10848
+ fp: SocketIoPair,
10849
+ ) -> CoroHttpServer.CoroHandleResult:
10826
10850
  gen = server.coro_handle()
10827
10851
 
10828
10852
  o = next(gen)
@@ -10851,8 +10875,8 @@ class CoroHttpServerSocketHandler(SocketHandler_):
10851
10875
  o = gen.send(i)
10852
10876
  else:
10853
10877
  o = next(gen)
10854
- except StopIteration:
10855
- break
10878
+ except StopIteration as e:
10879
+ return check.isinstance(e.value, CoroHttpServer.CoroHandleResult)
10856
10880
 
10857
10881
 
10858
10882
  ########################################
@@ -11666,6 +11690,7 @@ def make_simple_http_server(
11666
11690
  handler: HttpHandler,
11667
11691
  *,
11668
11692
  server_version: HttpProtocolVersion = HttpProtocolVersions.HTTP_1_1,
11693
+ keep_alive: bool = False,
11669
11694
  ssl_context: ta.Optional['ssl.SSLContext'] = None,
11670
11695
  ignore_ssl_errors: bool = False,
11671
11696
  executor: ta.Optional[cf.Executor] = None,
@@ -11687,6 +11712,7 @@ def make_simple_http_server(
11687
11712
 
11688
11713
  socket_handler = CoroHttpServerSocketHandler(
11689
11714
  server_factory,
11715
+ keep_alive=keep_alive,
11690
11716
  )
11691
11717
 
11692
11718
  #
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: omdev
3
- Version: 0.0.0.dev352
3
+ Version: 0.0.0.dev353
4
4
  Summary: omdev
5
5
  Author: wrmsr
6
6
  License: BSD-3-Clause
@@ -10,9 +10,9 @@ Classifier: Development Status :: 2 - Pre-Alpha
10
10
  Classifier: Intended Audience :: Developers
11
11
  Classifier: Operating System :: OS Independent
12
12
  Classifier: Operating System :: POSIX
13
- Requires-Python: >=3.12
13
+ Requires-Python: >=3.13
14
14
  License-File: LICENSE
15
- Requires-Dist: omlish==0.0.0.dev352
15
+ Requires-Dist: omlish==0.0.0.dev353
16
16
  Provides-Extra: all
17
17
  Requires-Dist: black~=25.1; extra == "all"
18
18
  Requires-Dist: pycparser~=2.22; extra == "all"
@@ -104,7 +104,7 @@ omdev/cli/__init__.py,sha256=V_l6VP1SZMlJbO-8CJwSuO9TThOy2S_oaPepNYgIrbE,37
104
104
  omdev/cli/__main__.py,sha256=mOJpgc07o0r5luQ1DlX4tk2PqZkgmbwPbdzJ3KmtjgQ,138
105
105
  omdev/cli/_pathhack.py,sha256=UshIZX3oeXq0De-9X28gy2LgKMZDf_dzabdkUhZJdNA,2124
106
106
  omdev/cli/clicli.py,sha256=LuOdHYh_YFULDxZCX6X0sB6JFpu6ogntVtN4WdT0o3Q,4481
107
- omdev/cli/install.py,sha256=Vy2-Qxgjua_80KLOAa7cUNn-WxtG7ebAmlkHfSTXkFM,4467
107
+ omdev/cli/install.py,sha256=Vzdq66boPdbNBIC_ommPOc-fVd1gWqTTcF_Mh_JECi0,4467
108
108
  omdev/cli/main.py,sha256=dxZFyzKuwRykHHhoKKUA0fUa9QsY0dgdvLHbXNuIPCY,6694
109
109
  omdev/cli/managers.py,sha256=BV98_n30Jj63OJrFgRoVZRfICxMLXEZKoEn4rMj9LV4,1160
110
110
  omdev/cli/types.py,sha256=SH88B81otsSYNM-PM3Ry1wgLLvyg2M6fBJkWOajWIWM,485
@@ -252,7 +252,7 @@ omdev/pyproject/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
252
252
  omdev/pyproject/resources/docker-dev.sh,sha256=DHkz5D18jok_oDolfg2mqrvGRWFoCe9GQo04dR1czcc,838
253
253
  omdev/pyproject/resources/python.sh,sha256=rFaN4SiJ9hdLDXXsDTwugI6zsw6EPkgYMmtacZeTbvw,749
254
254
  omdev/scripts/__init__.py,sha256=MKCvUAEQwsIvwLixwtPlpBqmkMXLCnjjXyAXvVpDwVk,91
255
- omdev/scripts/ci.py,sha256=flnF6i6PugpNKwbHKaHKZQ6K_7I158y1Xae8TyJmGRI,357027
255
+ omdev/scripts/ci.py,sha256=PCCZi3PDF8X9uVym6F898TjSYKOmMTRbRw-8cJrrRRY,358020
256
256
  omdev/scripts/interp.py,sha256=HHEFZJCO-1r_DLNA2bwmCDgcQiXf6hnCZ_6OALpmHrk,155558
257
257
  omdev/scripts/pyproject.py,sha256=Y_QRE_6kxo_k6oobXz4hON3ctPX6NV9I5N4VNZtRKfo,265039
258
258
  omdev/scripts/slowcat.py,sha256=lssv4yrgJHiWfOiHkUut2p8E8Tq32zB-ujXESQxFFHY,2728
@@ -303,9 +303,9 @@ omdev/tools/jsonview/resources/jsonview.js,sha256=faDvXDOXKvEvjOuIlz4D3F2ReQXb_b
303
303
  omdev/tools/pawk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
304
304
  omdev/tools/pawk/__main__.py,sha256=VCqeRVnqT1RPEoIrqHFSu4PXVMg4YEgF4qCQm90-eRI,66
305
305
  omdev/tools/pawk/pawk.py,sha256=zsEkfQX0jF5bn712uqPAyBSdJt2dno1LH2oeSMNfXQI,11424
306
- omdev-0.0.0.dev352.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
307
- omdev-0.0.0.dev352.dist-info/METADATA,sha256=BTgYhX0OjNbaJEehxMnyEyMrXCJrkVdvR8xEvjgmiQU,1674
308
- omdev-0.0.0.dev352.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
309
- omdev-0.0.0.dev352.dist-info/entry_points.txt,sha256=dHLXFmq5D9B8qUyhRtFqTGWGxlbx3t5ejedjrnXNYLU,33
310
- omdev-0.0.0.dev352.dist-info/top_level.txt,sha256=1nr7j30fEWgLYHW3lGR9pkdHkb7knv1U1ES1XRNVQ6k,6
311
- omdev-0.0.0.dev352.dist-info/RECORD,,
306
+ omdev-0.0.0.dev353.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
307
+ omdev-0.0.0.dev353.dist-info/METADATA,sha256=QYh5HbxL0eEAMdVGKbHcyCf0aPCXgqCdwj35yRG1UKo,1674
308
+ omdev-0.0.0.dev353.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
309
+ omdev-0.0.0.dev353.dist-info/entry_points.txt,sha256=dHLXFmq5D9B8qUyhRtFqTGWGxlbx3t5ejedjrnXNYLU,33
310
+ omdev-0.0.0.dev353.dist-info/top_level.txt,sha256=1nr7j30fEWgLYHW3lGR9pkdHkb7knv1U1ES1XRNVQ6k,6
311
+ omdev-0.0.0.dev353.dist-info/RECORD,,