pycrdt 0.12.37__cp313-cp313-win_amd64.whl → 0.12.40__cp313-cp313-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.

Potentially problematic release.


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

pycrdt/_base.py CHANGED
@@ -4,6 +4,7 @@ import threading
4
4
  from abc import ABC, abstractmethod
5
5
  from functools import lru_cache, partial
6
6
  from inspect import signature
7
+ from types import UnionType
7
8
  from typing import (
8
9
  TYPE_CHECKING,
9
10
  Any,
@@ -12,6 +13,8 @@ from typing import (
12
13
  Type,
13
14
  Union,
14
15
  cast,
16
+ get_args,
17
+ get_origin,
15
18
  get_type_hints,
16
19
  overload,
17
20
  )
@@ -388,10 +391,12 @@ class Typed:
388
391
  if key not in annotations:
389
392
  raise AttributeError(f'"{type(self).mro()[0]}" has no attribute "{key}"')
390
393
  expected_type = annotations[key]
391
- if hasattr(expected_type, "__origin__"):
392
- expected_type = expected_type.__origin__
393
- if hasattr(expected_type, "__args__"):
394
- expected_types = expected_type.__args__
394
+ origin = get_origin(expected_type)
395
+ if origin in (Union, UnionType):
396
+ expected_types = get_args(expected_type)
397
+ elif origin is not None:
398
+ expected_type = origin
399
+ expected_types = (expected_type,)
395
400
  else:
396
401
  expected_types = (expected_type,)
397
402
  if type(value) not in expected_types:
pycrdt/_provider.py CHANGED
@@ -141,10 +141,8 @@ class Provider:
141
141
  return self
142
142
 
143
143
  async def __aexit__(self, exc_type, exc_value, exc_tb):
144
- try:
145
- await self.stop()
146
- finally:
147
- return await self._exit_stack.__aexit__(exc_type, exc_value, exc_tb)
144
+ await self.stop()
145
+ return await self._exit_stack.__aexit__(exc_type, exc_value, exc_tb)
148
146
 
149
147
  @asynccontextmanager
150
148
  async def _get_or_create_task_group(self) -> AsyncIterator[TaskGroup]:
Binary file
pycrdt/_transaction.py CHANGED
@@ -73,16 +73,18 @@ class Transaction:
73
73
  # since nested transactions reuse the root transaction
74
74
  if self._leases == 0:
75
75
  assert self._txn is not None
76
- if not isinstance(self, ReadTransaction):
77
- self._txn.commit()
78
- origin_hash = self._txn.origin()
79
- if origin_hash is not None:
80
- del self._doc._origins[origin_hash]
81
- if self._doc._allow_multithreading:
82
- self._doc._txn_lock.release()
83
- self._txn.drop()
84
- self._txn = None
85
- self._doc._txn = None
76
+ try:
77
+ if not isinstance(self, ReadTransaction):
78
+ self._txn.commit()
79
+ origin_hash = self._txn.origin()
80
+ if origin_hash is not None:
81
+ del self._doc._origins[origin_hash]
82
+ if self._doc._allow_multithreading:
83
+ self._doc._txn_lock.release()
84
+ finally:
85
+ self._txn.drop()
86
+ self._txn = None
87
+ self._doc._txn = None
86
88
 
87
89
  async def __aenter__(self, _acquire_transaction: bool = True) -> Transaction:
88
90
  if self._leases > 0 and self._doc._task_group is None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pycrdt
3
- Version: 0.12.37
3
+ Version: 0.12.40
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -1,23 +1,23 @@
1
- pycrdt-0.12.37.dist-info/METADATA,sha256=03elvOSDV9llXXtxJ_HpAU_xIC_SWlNs4UnFa2ufS-w,1487
2
- pycrdt-0.12.37.dist-info/WHEEL,sha256=K7foeVF-x_RZTycPKa1uE1HH2bAWe3AiJbihrXn5Hhc,96
3
- pycrdt-0.12.37.dist-info/licenses/LICENSE,sha256=-uIz47KBJpIuEvvMUTwpg6OAiJJuqYajA4bW7QJ9o18,1102
1
+ pycrdt-0.12.40.dist-info/METADATA,sha256=VFcq9q1IHJd0bWaTTdfhUsTwjHvFsly4bwCk5-OpYOc,1487
2
+ pycrdt-0.12.40.dist-info/WHEEL,sha256=TJQY77QRLvXq32tEs9ATmwKO6NAOtuKOAw50eyiSmWU,96
3
+ pycrdt-0.12.40.dist-info/licenses/LICENSE,sha256=-uIz47KBJpIuEvvMUTwpg6OAiJJuqYajA4bW7QJ9o18,1102
4
4
  pycrdt/__init__.py,sha256=2fK0vWlJyzGEx767phtTDHrkCsEn0p4ftNxAFOK70CU,2150
5
5
  pycrdt/_array.py,sha256=YflwaoYzi_fSf9fLexyBrVJXGmJM5MJSBdQfn9HDRyE,15099
6
6
  pycrdt/_awareness.py,sha256=mKPNp5PVehxqy_cP1ErhITbp8YY52C3Ux2BsEuu8778,11208
7
- pycrdt/_base.py,sha256=GWWTRZ93KbR87Qug1nu0X-YYUWGLXYP5vg9HbwCyizc,13361
7
+ pycrdt/_base.py,sha256=4iw_7jtEwyZrzPCW_z9L8tZ7iq3aiVn55miB3dsBAXk,13482
8
8
  pycrdt/_doc.py,sha256=Hqxfs4GiCCxbbJ8kRL-mCMf3g1ZCRlfJ2pgmBPXO5r0,17305
9
9
  pycrdt/_map.py,sha256=2qPHaWX6U0dMy7QRkXclCsFO6Zt13UCtmJL332CtxSM,10969
10
- pycrdt/_provider.py,sha256=C4vjfsH7NlGtA7fPM6PM4oap49MYWKnjmiRjYyM1NyI,5511
11
- pycrdt/_pycrdt.cp313-win_amd64.pyd,sha256=aPHfF-yGbW3xNF3EeR5wMRSAJnnpu2sgR62qwyr1xeQ,1932800
10
+ pycrdt/_provider.py,sha256=E_fzs44tWvYa_NGd5HE6dUVd6N2B1S8S4d-sX_Ao6Es,5471
11
+ pycrdt/_pycrdt.cp313-win_amd64.pyd,sha256=FBCHkmDlHRdskR1AxHnJ5zfZa6LEDedteGiEMqQhshI,1934336
12
12
  pycrdt/_pycrdt.pyi,sha256=arzSIfs4E60vlWQ2y4s3l5tOsZaI7EzqrZnTUlWI7Lo,16614
13
13
  pycrdt/_snapshot.py,sha256=BpApwJ9WVqtJvXHHI_lu6KgaJxYS_Q2rMp9Y6R1H9EE,1422
14
14
  pycrdt/_sticky_index.py,sha256=GL4vNGPqqgLOGj_tm_1SDiAo6NuudvGAkXaTDvvuFi0,4612
15
15
  pycrdt/_sync.py,sha256=J9Czx3SxZ1_i-b8rkaeTju8ygCxcWYqejpBKvlfEvmU,8118
16
16
  pycrdt/_text.py,sha256=qxv7LZEWI7wSkK3hzXkIBw6AUu3zFJp6gYqac7B5ato,10726
17
- pycrdt/_transaction.py,sha256=Ly3adLLkMuTEiJ1GdNVGVuR6g4zMYOhVGVByUZWFMLE,5535
17
+ pycrdt/_transaction.py,sha256=lUm1b_viNqPjKjBDEVPOZwSWhos_e3utnAU-LzPNMrg,5615
18
18
  pycrdt/_undo.py,sha256=t7EjnQ7mta4dKyzqpGcCEVtTrITTY8aQ15ZpiVur8JE,4211
19
19
  pycrdt/_update.py,sha256=odt-Dsq2vKQTW_yfiqukmRTs5T6E4pe5Wl_PtrhH71w,1202
20
20
  pycrdt/_version.py,sha256=1B-NXFpddZSmM_1TNhtXeKRiTr9WBOpl5Mftxt7zCDc,190
21
21
  pycrdt/_xml.py,sha256=jHRpLpC07oH4KDY2RskGQ7HTcMqO-TFQj56xbnnwejM,18870
22
22
  pycrdt/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
- pycrdt-0.12.37.dist-info/RECORD,,
23
+ pycrdt-0.12.40.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: maturin (1.9.4)
2
+ Generator: maturin (1.9.6)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp313-cp313-win_amd64