pycrdt 0.12.38__tar.gz → 0.12.41__tar.gz

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.

Files changed (66) hide show
  1. {pycrdt-0.12.38 → pycrdt-0.12.41}/.github/workflows/publish.yml +5 -5
  2. {pycrdt-0.12.38 → pycrdt-0.12.41}/.github/workflows/test.yml +4 -3
  3. {pycrdt-0.12.38 → pycrdt-0.12.41}/CHANGELOG.md +9 -0
  4. {pycrdt-0.12.38 → pycrdt-0.12.41}/Cargo.lock +19 -19
  5. {pycrdt-0.12.38 → pycrdt-0.12.41}/Cargo.toml +2 -2
  6. {pycrdt-0.12.38 → pycrdt-0.12.41}/PKG-INFO +2 -1
  7. {pycrdt-0.12.38 → pycrdt-0.12.41}/pyproject.toml +1 -0
  8. {pycrdt-0.12.38 → pycrdt-0.12.41}/python/pycrdt/_base.py +9 -4
  9. {pycrdt-0.12.38 → pycrdt-0.12.41}/python/pycrdt/_provider.py +2 -4
  10. {pycrdt-0.12.38 → pycrdt-0.12.41}/src/doc.rs +2 -2
  11. {pycrdt-0.12.38 → pycrdt-0.12.41}/src/type_conversions.rs +3 -3
  12. {pycrdt-0.12.38 → pycrdt-0.12.41}/tests/test_typed.py +0 -1
  13. {pycrdt-0.12.38 → pycrdt-0.12.41}/.gitignore +0 -0
  14. {pycrdt-0.12.38 → pycrdt-0.12.41}/.pre-commit-config.yaml +0 -0
  15. {pycrdt-0.12.38 → pycrdt-0.12.41}/LICENSE +0 -0
  16. {pycrdt-0.12.38 → pycrdt-0.12.41}/README.md +0 -0
  17. {pycrdt-0.12.38 → pycrdt-0.12.41}/docs/api_reference.md +0 -0
  18. {pycrdt-0.12.38 → pycrdt-0.12.41}/docs/assets/logo.png +0 -0
  19. {pycrdt-0.12.38 → pycrdt-0.12.41}/docs/index.md +0 -0
  20. {pycrdt-0.12.38 → pycrdt-0.12.41}/docs/install.md +0 -0
  21. {pycrdt-0.12.38 → pycrdt-0.12.41}/docs/usage.md +0 -0
  22. {pycrdt-0.12.38 → pycrdt-0.12.41}/mkdocs.yml +0 -0
  23. {pycrdt-0.12.38 → pycrdt-0.12.41}/python/pycrdt/__init__.py +0 -0
  24. {pycrdt-0.12.38 → pycrdt-0.12.41}/python/pycrdt/_array.py +0 -0
  25. {pycrdt-0.12.38 → pycrdt-0.12.41}/python/pycrdt/_awareness.py +0 -0
  26. {pycrdt-0.12.38 → pycrdt-0.12.41}/python/pycrdt/_doc.py +0 -0
  27. {pycrdt-0.12.38 → pycrdt-0.12.41}/python/pycrdt/_map.py +0 -0
  28. {pycrdt-0.12.38 → pycrdt-0.12.41}/python/pycrdt/_pycrdt.pyi +0 -0
  29. {pycrdt-0.12.38 → pycrdt-0.12.41}/python/pycrdt/_snapshot.py +0 -0
  30. {pycrdt-0.12.38 → pycrdt-0.12.41}/python/pycrdt/_sticky_index.py +0 -0
  31. {pycrdt-0.12.38 → pycrdt-0.12.41}/python/pycrdt/_sync.py +0 -0
  32. {pycrdt-0.12.38 → pycrdt-0.12.41}/python/pycrdt/_text.py +0 -0
  33. {pycrdt-0.12.38 → pycrdt-0.12.41}/python/pycrdt/_transaction.py +0 -0
  34. {pycrdt-0.12.38 → pycrdt-0.12.41}/python/pycrdt/_undo.py +0 -0
  35. {pycrdt-0.12.38 → pycrdt-0.12.41}/python/pycrdt/_update.py +0 -0
  36. {pycrdt-0.12.38 → pycrdt-0.12.41}/python/pycrdt/_version.py +0 -0
  37. {pycrdt-0.12.38 → pycrdt-0.12.41}/python/pycrdt/_xml.py +0 -0
  38. {pycrdt-0.12.38 → pycrdt-0.12.41}/python/pycrdt/py.typed +0 -0
  39. {pycrdt-0.12.38 → pycrdt-0.12.41}/src/array.rs +0 -0
  40. {pycrdt-0.12.38 → pycrdt-0.12.41}/src/lib.rs +0 -0
  41. {pycrdt-0.12.38 → pycrdt-0.12.41}/src/map.rs +0 -0
  42. {pycrdt-0.12.38 → pycrdt-0.12.41}/src/snapshot.rs +0 -0
  43. {pycrdt-0.12.38 → pycrdt-0.12.41}/src/sticky_index.rs +0 -0
  44. {pycrdt-0.12.38 → pycrdt-0.12.41}/src/subscription.rs +0 -0
  45. {pycrdt-0.12.38 → pycrdt-0.12.41}/src/text.rs +0 -0
  46. {pycrdt-0.12.38 → pycrdt-0.12.41}/src/transaction.rs +0 -0
  47. {pycrdt-0.12.38 → pycrdt-0.12.41}/src/undo.rs +0 -0
  48. {pycrdt-0.12.38 → pycrdt-0.12.41}/src/update.rs +0 -0
  49. {pycrdt-0.12.38 → pycrdt-0.12.41}/src/xml.rs +0 -0
  50. {pycrdt-0.12.38 → pycrdt-0.12.41}/tests/conftest.py +0 -0
  51. {pycrdt-0.12.38 → pycrdt-0.12.41}/tests/test_array.py +0 -0
  52. {pycrdt-0.12.38 → pycrdt-0.12.41}/tests/test_awareness.py +0 -0
  53. {pycrdt-0.12.38 → pycrdt-0.12.41}/tests/test_doc.py +0 -0
  54. {pycrdt-0.12.38 → pycrdt-0.12.41}/tests/test_map.py +0 -0
  55. {pycrdt-0.12.38 → pycrdt-0.12.41}/tests/test_model.py +0 -0
  56. {pycrdt-0.12.38 → pycrdt-0.12.41}/tests/test_provider.py +0 -0
  57. {pycrdt-0.12.38 → pycrdt-0.12.41}/tests/test_snapshot.py +0 -0
  58. {pycrdt-0.12.38 → pycrdt-0.12.41}/tests/test_sync.py +0 -0
  59. {pycrdt-0.12.38 → pycrdt-0.12.41}/tests/test_text.py +0 -0
  60. {pycrdt-0.12.38 → pycrdt-0.12.41}/tests/test_threads.py +0 -0
  61. {pycrdt-0.12.38 → pycrdt-0.12.41}/tests/test_transaction.py +0 -0
  62. {pycrdt-0.12.38 → pycrdt-0.12.41}/tests/test_types.py +0 -0
  63. {pycrdt-0.12.38 → pycrdt-0.12.41}/tests/test_undo.py +0 -0
  64. {pycrdt-0.12.38 → pycrdt-0.12.41}/tests/test_update.py +0 -0
  65. {pycrdt-0.12.38 → pycrdt-0.12.41}/tests/test_xml.py +0 -0
  66. {pycrdt-0.12.38 → pycrdt-0.12.41}/tests/utils.py +0 -0
@@ -28,7 +28,7 @@ jobs:
28
28
  - name: Build wheels - universal2
29
29
  uses: PyO3/maturin-action@v1
30
30
  with:
31
- args: --release --target universal2-apple-darwin --out dist -i 3.10 3.11 3.12 3.13 pypy3.10
31
+ args: --release --target universal2-apple-darwin --out dist -i 3.10 3.11 3.12 3.13 3.14 pypy3.11
32
32
  - name: Test built wheel - universal2
33
33
  run: |
34
34
  pip install pytest pytest-mypy-testing "pydantic>=2.5.2,<3" "anyio>=4.4.0,<5" "trio>=0.25.1,<0.32" "exceptiongroup; python_version<'3.11'"
@@ -47,9 +47,9 @@ jobs:
47
47
  matrix:
48
48
  platform:
49
49
  - target: x64
50
- interpreter: ["3.10", "3.11", "3.12", "3.13"]
50
+ interpreter: ["3.10", "3.11", "3.12", "3.13", "3.14"]
51
51
  - target: x86
52
- interpreter: ["3.10", "3.11", "3.12", "3.13"]
52
+ interpreter: ["3.10", "3.11", "3.12", "3.13", "3.14"]
53
53
  steps:
54
54
  - uses: actions/checkout@v4
55
55
  - uses: actions/setup-python@v5
@@ -98,7 +98,7 @@ jobs:
98
98
  rust-toolchain: stable
99
99
  target: ${{ matrix.target }}
100
100
  manylinux: auto
101
- args: --release --out dist -i 3.10 3.11 3.12 3.13 pypy3.10
101
+ args: --release --out dist -i 3.10 3.11 3.12 3.13 3.14 pypy3.11
102
102
  - name: Test built wheel
103
103
  if: matrix.target == 'x86_64'
104
104
  run: |
@@ -127,7 +127,7 @@ jobs:
127
127
  rust-toolchain: stable
128
128
  target: ${{ matrix.target }}
129
129
  manylinux: auto
130
- args: --release --out dist -i 3.10 3.11 3.12 3.13 pypy3.10
130
+ args: --release --out dist -i 3.10 3.11 3.12 3.13 3.14 pypy3.11
131
131
 
132
132
  - uses: uraimo/run-on-arch-action@v2.8.1
133
133
  name: Test built wheel
@@ -25,7 +25,8 @@ jobs:
25
25
  - '3.11'
26
26
  - '3.12'
27
27
  - '3.13'
28
- - 'pypy3.10'
28
+ - '3.14'
29
+ - 'pypy3.11'
29
30
 
30
31
  runs-on: ${{ matrix.os }}-latest
31
32
 
@@ -59,11 +60,11 @@ jobs:
59
60
  run: mypy python
60
61
 
61
62
  - name: Run tests
62
- if: ${{ !((matrix.python-version == '3.13') && (matrix.os == 'ubuntu')) }}
63
+ if: ${{ !((matrix.python-version == '3.14') && (matrix.os == 'ubuntu')) }}
63
64
  run: pytest --color=yes -v tests
64
65
 
65
66
  - name: Run code coverage
66
- if: ${{ (matrix.python-version == '3.13') && (matrix.os == 'ubuntu') }}
67
+ if: ${{ (matrix.python-version == '3.14') && (matrix.os == 'ubuntu') }}
67
68
  run: |
68
69
  coverage run -m pytest tests
69
70
  coverage report --show-missing --fail-under=100
@@ -1,5 +1,14 @@
1
1
  # Version history
2
2
 
3
+ ## 0.12.41
4
+
5
+ - Bump `pyo3` to v0.27.0.
6
+ - Drop PyPy 3.10 support.
7
+
8
+ ## 0.12.40
9
+
10
+ - Support Python v3.14.
11
+
3
12
  ## 0.12.38
4
13
 
5
14
  - Improve error propagation with `PyResult`.
@@ -38,9 +38,9 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
38
38
 
39
39
  [[package]]
40
40
  name = "bitflags"
41
- version = "2.9.4"
41
+ version = "2.10.0"
42
42
  source = "registry+https://github.com/rust-lang/crates.io-index"
43
- checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394"
43
+ checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"
44
44
 
45
45
  [[package]]
46
46
  name = "bumpalo"
@@ -50,9 +50,9 @@ checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43"
50
50
 
51
51
  [[package]]
52
52
  name = "cfg-if"
53
- version = "1.0.3"
53
+ version = "1.0.4"
54
54
  source = "registry+https://github.com/rust-lang/crates.io-index"
55
- checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9"
55
+ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
56
56
 
57
57
  [[package]]
58
58
  name = "concurrent-queue"
@@ -162,9 +162,9 @@ dependencies = [
162
162
 
163
163
  [[package]]
164
164
  name = "libc"
165
- version = "0.2.176"
165
+ version = "0.2.177"
166
166
  source = "registry+https://github.com/rust-lang/crates.io-index"
167
- checksum = "58f929b4d672ea937a23a1ab494143d968337a5f47e56d0815df1e0890ddf174"
167
+ checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976"
168
168
 
169
169
  [[package]]
170
170
  name = "lock_api"
@@ -244,7 +244,7 @@ dependencies = [
244
244
 
245
245
  [[package]]
246
246
  name = "pycrdt"
247
- version = "0.12.38"
247
+ version = "0.12.41"
248
248
  dependencies = [
249
249
  "pyo3",
250
250
  "serde_json",
@@ -253,9 +253,9 @@ dependencies = [
253
253
 
254
254
  [[package]]
255
255
  name = "pyo3"
256
- version = "0.26.0"
256
+ version = "0.27.0"
257
257
  source = "registry+https://github.com/rust-lang/crates.io-index"
258
- checksum = "7ba0117f4212101ee6544044dae45abe1083d30ce7b29c4b5cbdfa2354e07383"
258
+ checksum = "fa8e48c12afdeb26aa4be4e5c49fb5e11c3efa0878db783a960eea2b9ac6dd19"
259
259
  dependencies = [
260
260
  "indoc",
261
261
  "libc",
@@ -270,18 +270,18 @@ dependencies = [
270
270
 
271
271
  [[package]]
272
272
  name = "pyo3-build-config"
273
- version = "0.26.0"
273
+ version = "0.27.0"
274
274
  source = "registry+https://github.com/rust-lang/crates.io-index"
275
- checksum = "4fc6ddaf24947d12a9aa31ac65431fb1b851b8f4365426e182901eabfb87df5f"
275
+ checksum = "bc1989dbf2b60852e0782c7487ebf0b4c7f43161ffe820849b56cf05f945cee1"
276
276
  dependencies = [
277
277
  "target-lexicon",
278
278
  ]
279
279
 
280
280
  [[package]]
281
281
  name = "pyo3-ffi"
282
- version = "0.26.0"
282
+ version = "0.27.0"
283
283
  source = "registry+https://github.com/rust-lang/crates.io-index"
284
- checksum = "025474d3928738efb38ac36d4744a74a400c901c7596199e20e45d98eb194105"
284
+ checksum = "c808286da7500385148930152e54fb6883452033085bf1f857d85d4e82ca905c"
285
285
  dependencies = [
286
286
  "libc",
287
287
  "pyo3-build-config",
@@ -289,9 +289,9 @@ dependencies = [
289
289
 
290
290
  [[package]]
291
291
  name = "pyo3-macros"
292
- version = "0.26.0"
292
+ version = "0.27.0"
293
293
  source = "registry+https://github.com/rust-lang/crates.io-index"
294
- checksum = "2e64eb489f22fe1c95911b77c44cc41e7c19f3082fc81cce90f657cdc42ffded"
294
+ checksum = "83a0543c16be0d86cf0dbf2e2b636ece9fd38f20406bb43c255e0bc368095f92"
295
295
  dependencies = [
296
296
  "proc-macro2",
297
297
  "pyo3-macros-backend",
@@ -301,9 +301,9 @@ dependencies = [
301
301
 
302
302
  [[package]]
303
303
  name = "pyo3-macros-backend"
304
- version = "0.26.0"
304
+ version = "0.27.0"
305
305
  source = "registry+https://github.com/rust-lang/crates.io-index"
306
- checksum = "100246c0ecf400b475341b8455a9213344569af29a3c841d29270e53102e0fcf"
306
+ checksum = "2a00da2ce064dcd582448ea24a5a26fa9527e0483103019b741ebcbe632dcd29"
307
307
  dependencies = [
308
308
  "heck",
309
309
  "proc-macro2",
@@ -408,9 +408,9 @@ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
408
408
 
409
409
  [[package]]
410
410
  name = "syn"
411
- version = "2.0.106"
411
+ version = "2.0.107"
412
412
  source = "registry+https://github.com/rust-lang/crates.io-index"
413
- checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6"
413
+ checksum = "2a26dbd934e5451d21ef060c018dae56fc073894c5a7896f882928a76e6d081b"
414
414
  dependencies = [
415
415
  "proc-macro2",
416
416
  "quote",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "pycrdt"
3
- version = "0.12.38"
3
+ version = "0.12.41"
4
4
  edition = "2021"
5
5
  readme = "README.md"
6
6
 
@@ -13,4 +13,4 @@ serde_json = "1.0.140"
13
13
  yrs = "0.24.0"
14
14
 
15
15
  [dependencies.pyo3]
16
- version = "0.26.0"
16
+ version = "0.27.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pycrdt
3
- Version: 0.12.38
3
+ Version: 0.12.41
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -9,6 +9,7 @@ Classifier: Programming Language :: Python :: 3.10
9
9
  Classifier: Programming Language :: Python :: 3.11
10
10
  Classifier: Programming Language :: Python :: 3.12
11
11
  Classifier: Programming Language :: Python :: 3.13
12
+ Classifier: Programming Language :: Python :: 3.14
12
13
  Classifier: Programming Language :: Rust
13
14
  Classifier: Programming Language :: Python :: Implementation :: CPython
14
15
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -24,6 +24,7 @@ classifiers = [
24
24
  "Programming Language :: Python :: 3.11",
25
25
  "Programming Language :: Python :: 3.12",
26
26
  "Programming Language :: Python :: 3.13",
27
+ "Programming Language :: Python :: 3.14",
27
28
  "Programming Language :: Rust",
28
29
  "Programming Language :: Python :: Implementation :: CPython",
29
30
  "Programming Language :: Python :: Implementation :: PyPy",
@@ -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:
@@ -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]:
@@ -71,14 +71,14 @@ impl Doc {
71
71
  fn new(client_id: &Bound<'_, PyAny>, skip_gc: &Bound<'_, PyAny>) -> PyResult<Self> {
72
72
  let mut options = Options::default();
73
73
  if !client_id.is_none() {
74
- let _client_id: u64 = client_id.downcast::<PyInt>()
74
+ let _client_id: u64 = client_id.cast::<PyInt>()
75
75
  .map_err(|_| PyValueError::new_err("client_id must be an integer"))?
76
76
  .extract()
77
77
  .map_err(|_| PyValueError::new_err("client_id must be a valid u64"))?;
78
78
  options.client_id = _client_id;
79
79
  }
80
80
  if !skip_gc.is_none() {
81
- let _skip_gc: bool = skip_gc.downcast::<PyBool>()
81
+ let _skip_gc: bool = skip_gc.cast::<PyBool>()
82
82
  .map_err(|_| PyValueError::new_err("skip_gc must be a boolean"))?
83
83
  .extract()
84
84
  .map_err(|_| PyValueError::new_err("skip_gc must be a valid bool"))?;
@@ -236,17 +236,17 @@ pub fn py_to_any<'py>(value: &Bound<'py, PyAny>) -> Any {
236
236
  } else if value.is_instance_of::<PyFloat>() {
237
237
  let v: f64 = value.extract().unwrap();
238
238
  Any::Number(v)
239
- } else if let Ok(v) = value.downcast::<PyList>() {
239
+ } else if let Ok(v) = value.cast::<PyList>() {
240
240
  let mut items = Vec::new();
241
241
  for i in v.iter() {
242
242
  let a = py_to_any(&i);
243
243
  items.push(a);
244
244
  }
245
245
  Any::Array(items.into())
246
- } else if let Ok(val) = value.downcast::<PyDict>() {
246
+ } else if let Ok(val) = value.cast::<PyDict>() {
247
247
  let mut items: HashMap<String, Any> = HashMap::new();
248
248
  for (k, v) in val.iter() {
249
- let k = k.downcast::<PyString>().unwrap().to_str().unwrap().to_string();
249
+ let k = k.cast::<PyString>().unwrap().to_str().unwrap().to_string();
250
250
  let v = py_to_any(&v);
251
251
  items.insert(k, v);
252
252
  }
@@ -55,7 +55,6 @@ class MyTypedDoc(MySubTypedDoc):
55
55
  my_array: MyTypedArray
56
56
 
57
57
 
58
- @pytest.mark.skipif(sys.version_info < (3, 10), reason="requires python3.10 or higher")
59
58
  def test_typed():
60
59
  doc = Doc()
61
60
  assert MyTypedDoc(doc)._ is doc
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes