diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e48f8f..f7ac6ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -158,15 +158,15 @@ jobs: ls: dir target: i686 python-architecture: x86 - interpreter: 3.9 3.10 3.11 3.12 3.13 + interpreter: 3.9 3.10 3.11 3.12 3.13 3.14 - os: windows ls: dir target: x86_64 - interpreter: 3.9 3.10 3.11 3.12 3.13 + interpreter: 3.9 3.10 3.11 3.12 3.13 3.14 - os: windows ls: dir target: aarch64 - interpreter: 3.11 3.12 3.13 + interpreter: 3.11 3.12 3.13 3.14 - os: ubuntu platform: linux target: i686 @@ -192,12 +192,12 @@ jobs: runs-on: ${{ matrix.os }}-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: set up python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: - python-version: "3.11" + python-version: "3.13" architecture: ${{ matrix.python-architecture || 'x64' }} - name: check GITHUB_REF matches package version diff --git a/Cargo.lock b/Cargo.lock index fb24fd8..4135230 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -191,9 +191,9 @@ checksum = "5e0826a989adedc2a244799e823aece04662b66609d96af8dff7ac6df9a8925d" [[package]] name = "once_cell" -version = "1.19.0" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "portable-atomic" @@ -212,9 +212,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.25.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8970a78afe0628a3e3430376fc5fd76b6b45c4d43360ffd6cdd40bdde72b682a" +checksum = "7ba0117f4212101ee6544044dae45abe1083d30ce7b29c4b5cbdfa2354e07383" dependencies = [ "indoc", "libc", @@ -229,20 +229,19 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.25.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "458eb0c55e7ece017adeba38f2248ff3ac615e53660d7c71a238d7d2a01c7598" +checksum = "4fc6ddaf24947d12a9aa31ac65431fb1b851b8f4365426e182901eabfb87df5f" dependencies = [ - "once_cell", "python3-dll-a", "target-lexicon", ] [[package]] name = "pyo3-ffi" -version = "0.25.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7114fe5457c61b276ab77c5055f206295b812608083644a5c5b2640c3102565c" +checksum = "025474d3928738efb38ac36d4744a74a400c901c7596199e20e45d98eb194105" dependencies = [ "libc", "pyo3-build-config", @@ -250,9 +249,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.25.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8725c0a622b374d6cb051d11a0983786448f7785336139c3c94f5aa6bef7e50" +checksum = "2e64eb489f22fe1c95911b77c44cc41e7c19f3082fc81cce90f657cdc42ffded" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -262,9 +261,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.25.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4109984c22491085343c05b0dbc54ddc405c3cf7b4374fc533f5c3313a572ccc" +checksum = "100246c0ecf400b475341b8455a9213344569af29a3c841d29270e53102e0fcf" dependencies = [ "heck", "proc-macro2", @@ -275,9 +274,9 @@ dependencies = [ [[package]] name = "python3-dll-a" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49fe4227a288cf9493942ad0220ea3f185f4d1f2a14f197f7344d6d02f4ed4ed" +checksum = "d381ef313ae70b4da5f95f8a4de773c6aa5cd28f73adec4b4a31df70b66780d8" dependencies = [ "cc", ] @@ -361,6 +360,7 @@ dependencies = [ "crossbeam-channel", "notify", "pyo3", + "pyo3-build-config", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 0e284c2..616ad0e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ rust-version = "1.77" [dependencies] crossbeam-channel = "0.5.15" notify = { version = "8.0.0" } -pyo3 = { version = "0.25.1", features = [ +pyo3 = { version = "0.26.0", features = [ "extension-module", "generate-import-lib", ] } diff --git a/src/lib.rs b/src/lib.rs index bbd60eb..f1a5f7a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -264,8 +264,8 @@ impl RustNotify { debounce_ms: u64, step_ms: u64, timeout_ms: u64, - stop_event: PyObject, - ) -> PyResult { + stop_event: Py, + ) -> PyResult> { if matches!(slf.borrow().watcher, WatcherEnum::None) { return Err(PyRuntimeError::new_err("RustNotify watcher closed")); } @@ -282,7 +282,7 @@ impl RustNotify { _ => Some(SystemTime::now() + Duration::from_millis(timeout_ms)), }; loop { - py.allow_threads(|| sleep(step_time)); + py.detach(|| sleep(step_time)); match py.check_signals() { Ok(_) => (), Err(_) => { @@ -348,7 +348,7 @@ impl RustNotify { self.watcher = WatcherEnum::None; } - fn __exit__(&mut self, _exc_type: PyObject, _exc_value: PyObject, _traceback: PyObject) { + fn __exit__(&mut self, _exc_type: Py, _exc_value: Py, _traceback: Py) { self.close(); }