From 58ba3db0cacc591da915bb67b12f73671e2f1e2f Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Mon, 6 May 2024 08:42:35 +0100 Subject: [PATCH 1/5] uprev pyo3 --- .github/workflows/ci.yml | 6 +++--- Cargo.lock | 32 ++++++++++++++------------------ Cargo.toml | 5 +++-- src/lib.rs | 8 ++++---- 4 files changed, 24 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4c3c3b0..1a4a87fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: fail-fast: false matrix: os: [ubuntu, macos, windows] - rust-version: [stable, '1.56.0'] + rust-version: [stable, '1.63.0'] python-version: - '3.8' - '3.9' @@ -26,9 +26,9 @@ jobs: - 'pypy3.9' - 'pypy3.10' exclude: - - rust-version: '1.56.0' + - rust-version: '1.63.0' os: macos - - rust-version: '1.56.0' + - rust-version: '1.63.0' os: windows runs-on: ${{ matrix.os }}-latest diff --git a/Cargo.lock b/Cargo.lock index c1cc8125..030a9e8d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -31,22 +31,18 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "crossbeam-channel" -version = "0.5.7" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2b3e8478797446514c91ef04bafcb59faba183e621ad488df88983cc14128c" +checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.15" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "filetime" @@ -231,9 +227,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.20.3" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53bdbb96d49157e65d45cc287af5f32ffadd5f4761438b527b055fb0d4bb8233" +checksum = "a5e00b96a521718e08e03b1a622f01c8a8deb50719335de3f60b3b3950f069d8" dependencies = [ "cfg-if", "indoc", @@ -249,9 +245,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.20.3" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deaa5745de3f5231ce10517a1f5dd97d53e5a2fd77aa6b5842292085831d48d7" +checksum = "7883df5835fafdad87c0d888b266c8ec0f4c9ca48a5bed6bbb592e8dedee1b50" dependencies = [ "once_cell", "python3-dll-a", @@ -260,9 +256,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.20.3" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b42531d03e08d4ef1f6e85a2ed422eb678b8cd62b762e53891c05faf0d4afa" +checksum = "01be5843dc60b916ab4dad1dca6d20b9b4e6ddc8e15f50c47fe6d85f1fb97403" dependencies = [ "libc", "pyo3-build-config", @@ -270,9 +266,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.20.3" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7305c720fa01b8055ec95e484a6eca7a83c841267f0dd5280f0c8b8551d2c158" +checksum = "77b34069fc0682e11b31dbd10321cbf94808394c56fd996796ce45217dfac53c" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -282,9 +278,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.20.3" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c7e9b68bb9c3149c5b0cade5d07f953d6d125eb4337723c4ccdb665f1f96185" +checksum = "08260721f32db5e1a5beae69a55553f56b99bd0e1c3e6e0a5e8851a9d0f5a85c" dependencies = [ "heck", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index 4f7c15b8..9f2acdc9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,11 +21,12 @@ include = [ "!tests/.pytest_cache", "!*.so", ] +rust-version = "1.63" [dependencies] -crossbeam-channel = "0.5.4" +crossbeam-channel = "0.5.12" notify = "5.0.0" -pyo3 = {version = "=0.20", features = ["extension-module", "generate-import-lib"]} +pyo3 = {version = "0.21.2", features = ["extension-module", "generate-import-lib"]} [lib] name = "_rust_notify" diff --git a/src/lib.rs b/src/lib.rs index 6759431b..7198a573 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -244,7 +244,7 @@ impl RustNotify { } pub fn watch( - slf: &PyCell, + slf: &Bound, py: Python, debounce_ms: u64, step_ms: u64, @@ -289,7 +289,7 @@ impl RustNotify { } if let Some(is_set) = stop_event_is_set { - if is_set.call0()?.is_true()? { + if is_set.call0()?.is_truthy()? { if slf.borrow().debug { eprintln!("stop event set, stopping..."); } @@ -350,7 +350,7 @@ impl RustNotify { } #[pymodule] -fn _rust_notify(py: Python, m: &PyModule) -> PyResult<()> { +fn _rust_notify(py: Python, m: &Bound) -> PyResult<()> { let mut version = env!("CARGO_PKG_VERSION").to_string(); // cargo uses "1.0-alpha1" etc. while python uses "1.0.0a1", this is not full compatibility, // but it's good enough for now @@ -361,7 +361,7 @@ fn _rust_notify(py: Python, m: &PyModule) -> PyResult<()> { m.add("__version__", version)?; m.add( "WatchfilesRustInternalError", - py.get_type::(), + py.get_type_bound::(), )?; m.add_class::()?; Ok(()) From e703e860984767b46711eacfd048a6ea863af427 Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Mon, 6 May 2024 08:45:51 +0100 Subject: [PATCH 2/5] bump From 4bc337e09b105823d76a89efa9dcc59eaef0acab Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Mon, 6 May 2024 08:53:09 +0100 Subject: [PATCH 3/5] uprev actions to fix build --- .github/workflows/ci.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a4a87fb..73f176f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,10 +39,10 @@ jobs: OS: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: set up python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -83,9 +83,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: '3.10' @@ -111,10 +111,10 @@ jobs: docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: set up python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.10' @@ -125,7 +125,7 @@ jobs: run: mkdocs build - name: store docs site - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: docs path: site @@ -186,10 +186,10 @@ jobs: runs-on: ${{ matrix.os }}-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: set up python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.10' architecture: ${{ matrix.python-architecture || 'x64' }} @@ -226,7 +226,7 @@ jobs: - run: ${{ matrix.ls || 'ls -lh' }} dist/ - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: pypi_files path: dist @@ -236,10 +236,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: get dist artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: pypi_files path: dist @@ -281,23 +281,23 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: set up python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.10' - run: pip install twine - name: get dist artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: pypi_files path: dist - name: get docs - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: docs path: site From 62904663545f5915ea033c3b84fbfb7691ad081f Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Mon, 6 May 2024 09:16:40 +0100 Subject: [PATCH 4/5] try to fix build --- .github/workflows/ci.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73f176f8..31c4b523 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -191,7 +191,7 @@ jobs: - name: set up python uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.11' architecture: ${{ matrix.python-architecture || 'x64' }} - name: set package version @@ -204,13 +204,13 @@ jobs: - name: build sdist if: ${{ matrix.os == 'ubuntu' && matrix.target == 'x86_64' && matrix.manylinux == 'auto' }} - uses: messense/maturin-action@v1 + uses: PyO3/maturin-action@v1 with: command: sdist args: --out dist - name: build wheels - uses: messense/maturin-action@v1 + uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} manylinux: ${{ matrix.manylinux || 'auto' }} @@ -218,7 +218,7 @@ jobs: - name: build pypy wheels if: ${{ matrix.pypy }} - uses: messense/maturin-action@v1 + uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} manylinux: ${{ matrix.manylinux || 'auto' }} @@ -228,7 +228,7 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: pypi_files + name: pypi_files_${{ matrix.os }}_${{ matrix.target }}_${{ matrix.interpreter || 'all' }}_${{ matrix.manylinux }} path: dist list-pypi-files: @@ -293,7 +293,8 @@ jobs: - name: get dist artifacts uses: actions/download-artifact@v4 with: - name: pypi_files + pattern: pypi_files_* + merge-multiple: true path: dist - name: get docs From 4066963b6d7ea6dcbf4a082da9d09ea86297e223 Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Mon, 6 May 2024 09:36:11 +0100 Subject: [PATCH 5/5] fix ci ... again --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31c4b523..d0a1f88a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -241,7 +241,8 @@ jobs: - name: get dist artifacts uses: actions/download-artifact@v4 with: - name: pypi_files + pattern: pypi_files_* + merge-multiple: true path: dist - name: list dist files