summaryrefslogtreecommitdiff
path: root/debian/patches/upstream-0001-bump-pyo3-dep.patch
blob: 5d060b60913896ebd53430861feeeb4eb831d9f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
From f64eefcb4b082fe68a9b499c83380c454c8e02da Mon Sep 17 00:00:00 2001
From 426b1a02d340fbf3457c2c5ed74e6a0045c6855d Mon Sep 17 00:00:00 2001
From: "Kai A. Hiller" <V02460@gmail.com>
Subject: [PATCH] PushRuleEvaluator: Add pyo3 signature annotation
Subject: [PATCH] Bump pyo3 from 0.17.1 to 0.19.2

Antonio Russo: Composite of two patches, with changes to Cargo.lock dropped

Bump pyo3 version to 19.2 to keep up with the latest release and benefit from
improved compatibility with Python 3.12. Pythonize is bumped to v0.19.0
to match pyo3.

Also bumps the minimum abi3 of pyo3 from py37 to py38 as Python 3.7 is EOL.

Signed-off-by: Kai A. Hiller <V02460@gmail.com>

---
diff --git a/rust/Cargo.toml b/rust/Cargo.toml
index 16917136db..42799fcd16 100644
--- a/rust/Cargo.toml
+++ b/rust/Cargo.toml
@@ -23,14 +23,14 @@ name = "synapse.synapse_rust"
 anyhow = "1.0.63"
 lazy_static = "1.4.0"
 log = "0.4.17"
-pyo3 = { version = "0.17.1", features = [
+pyo3 = { version = "0.19.0", features = [
     "macros",
     "anyhow",
     "abi3",
     "abi3-py37",
 ] }
 pyo3-log = "0.8.1"
-pythonize = "0.17.0"
+pythonize = "0.19.0"
 regex = "1.6.0"
 serde = { version = "1.0.144", features = ["derive"] }
 serde_json = "1.0.85"
diff --git a/rust/src/push/evaluator.rs b/rust/src/push/evaluator.rs
index 5b9bf9b26a..20eb665d7f 100644
--- a/rust/src/push/evaluator.rs
+++ b/rust/src/push/evaluator.rs
@@ -105,6 +105,17 @@ impl PushRuleEvaluator {
     /// Create a new `PushRuleEvaluator`. See struct docstring for details.
     #[allow(clippy::too_many_arguments)]
     #[new]
+    #[pyo3(signature = (
+        flattened_keys,
+        has_mentions,
+        room_member_count,
+        sender_power_level,
+        notification_power_levels,
+        related_events_flattened,
+        related_event_match_enabled,
+        room_version_feature_flags,
+        msc3931_enabled,
+    ))]
     pub fn py_new(
         flattened_keys: BTreeMap<String, JsonValue>,
         has_mentions: bool,