File: 0002-Make-remote-sync-optional.patch

package info (click to toggle)
python-taskchampion-py 2.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 360 kB
  • sloc: python: 682; makefile: 15
file content (50 lines) | stat: -rw-r--r-- 1,291 bytes parent folder | download | duplicates (2)
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
From: Jochen Sprickerhof <git@jochen.sprickerhof.de>
Date: Sun, 22 Feb 2026 08:31:52 +0100
Subject: Make remote sync optional

---
 Cargo.toml     | 10 ++++++++++
 src/replica.rs |  2 ++
 2 files changed, 12 insertions(+)

diff --git a/Cargo.toml b/Cargo.toml
index ead38f0..949e322 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -5,6 +5,16 @@ edition = "2021"
 # This should match the MSRV of the `taskchampion` crate.
 rust-version = "1.81.0"
 
+[features]
+default = []
+
+# Support for all sync solutions
+sync = ["server-sync", "server-gcp"]
+# Support for sync to a server
+server-sync = []
+# Support for sync to GCP
+server-gcp = []
+
 [package.metadata.maturin]
 name = "taskchampion"
 
diff --git a/src/replica.rs b/src/replica.rs
index 18a2ab8..cf17683 100644
--- a/src/replica.rs
+++ b/src/replica.rs
@@ -137,6 +137,7 @@ impl Replica {
     }
 
     /// Sync with a server created from `ServerConfig::Remote`.
+    #[cfg(feature = "server-sync")]
     fn sync_to_remote(
         &mut self,
         url: String,
@@ -157,6 +158,7 @@ impl Replica {
     }
 
     /// Sync with a server created from `ServerConfig::Gcp`.
+    #[cfg(feature = "server-gcp")]
     #[pyo3(signature=(bucket, credential_path, encryption_secret, avoid_snapshots))]
     fn sync_to_gcp(
         &mut self,