From 06522916c539cf9e81155663118ac399c58705a5 Mon Sep 17 00:00:00 2001 From: yu1005 <109812036+jeromychu23@users.noreply.github.com> Date: Fri, 6 Mar 2026 16:21:50 +0800 Subject: [PATCH] Bump conda recipe build number to 1 --- .github/workflows/CI.yml | 5 ++ .github/workflows/build-wheels.yml | 1 + .github/workflows/maturin-canary.yml | 42 +++++++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- recipe/meta.yaml | 4 +- src/lib.rs | 109 +++++++++++++++++++++------ 7 files changed, 140 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/maturin-canary.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9fd25ff..3d0e0e3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -44,6 +44,7 @@ jobs: - name: Build wheels uses: PyO3/maturin-action@v1 with: + maturin-version: "1.12.5" target: ${{ matrix.platform.target }} args: --release --out dist --find-interpreter sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} @@ -75,6 +76,7 @@ jobs: - name: Build wheels uses: PyO3/maturin-action@v1 with: + maturin-version: "1.12.5" target: ${{ matrix.platform.target }} args: --release --out dist --find-interpreter sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} @@ -108,6 +110,7 @@ jobs: - name: Build wheels uses: PyO3/maturin-action@v1 with: + maturin-version: "1.12.5" target: ${{ matrix.platform.target }} args: --release --out dist --find-interpreter sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} @@ -134,6 +137,7 @@ jobs: - name: Build wheels uses: PyO3/maturin-action@v1 with: + maturin-version: "1.12.5" target: ${{ matrix.platform.target }} args: --release --out dist --find-interpreter sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} @@ -150,6 +154,7 @@ jobs: - name: Build sdist uses: PyO3/maturin-action@v1 with: + maturin-version: "1.12.5" command: sdist args: --out dist - name: Upload sdist diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 953e1c1..3a5a47d 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -24,6 +24,7 @@ jobs: - name: Build wheels with maturin uses: PyO3/maturin-action@v1 with: + maturin-version: "1.12.5" command: build args: --release --interpreter python${{ matrix.python-version }} manylinux: auto diff --git a/.github/workflows/maturin-canary.yml b/.github/workflows/maturin-canary.yml new file mode 100644 index 0000000..a169ac1 --- /dev/null +++ b/.github/workflows/maturin-canary.yml @@ -0,0 +1,42 @@ +name: Maturin Canary + +on: + schedule: + - cron: '0 3 * * 1' + workflow_dispatch: + +permissions: + contents: read + +jobs: + canary: + name: canary-${{ matrix.platform.name }} + runs-on: ${{ matrix.platform.runner }} + strategy: + fail-fast: false + matrix: + platform: + - name: linux-x86_64 + runner: ubuntu-22.04 + target: x86_64 + manylinux: auto + - name: musllinux-x86_64 + runner: ubuntu-22.04 + target: x86_64 + manylinux: musllinux_1_2 + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 + with: + python-version: '3.x' + - name: Build wheels with latest allowed maturin + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter + manylinux: ${{ matrix.platform.manylinux }} + - name: Upload canary wheels + uses: actions/upload-artifact@v6 + with: + name: canary-${{ matrix.platform.name }} + path: dist diff --git a/Cargo.lock b/Cargo.lock index 390043c..8aad74a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16,7 +16,7 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hello_rust" -version = "0.1.3" +version = "0.1.4" dependencies = [ "pyo3", ] diff --git a/Cargo.toml b/Cargo.toml index b4a8ebf..204ea54 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello_rust" -version = "0.1.3" +version = "0.1.4" edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 3e6a0c7..f438a6d 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,5 +1,5 @@ {% set name = "hello-rust" %} -{% set version = "0.1.3" %} +{% set version = "0.1.4" %} package: name: {{ name|lower }} @@ -9,7 +9,7 @@ source: path: .. build: - number: 0 + number: 1 script: {{ PYTHON }} -m pip install . -vv requirements: diff --git a/src/lib.rs b/src/lib.rs index 88b5574..5fda83e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -215,9 +215,10 @@ fn has_blocker_on_node_after_target( /// If no valid candidate is found, the original value is kept unchanged. /// /// block_key: -/// - Optional key/value matcher applied at node level for both self and ancestor nodes. -/// - For the current self and each ancestor node encountered during traversal, if that node -/// has any blocker event with target_col > current reference target, traversal is terminated. +/// - Optional key/value matcher applied at node level for the current parent chain. +/// - For each parent node encountered during traversal (starting from this row's immediate +/// parent), if that node has any blocker event with target_col > current reference target, +/// traversal is terminated. /// - In that case the original target value remains unchanged. fn propagate_target_rows( py: Python<'_>, @@ -259,21 +260,7 @@ fn propagate_target_rows( if !is_valid_target(Some(start_target.clone())) { continue; } - - let start_self_key = composite_key(&start_row, self_cols)?; - if let Some(kv) = block_key { - if has_blocker_on_node_after_target( - py, - rows, - &self_index_all, - &start_self_key, - &start_target, - target_col, - kv, - )? { - continue; - } - } + let anchor_target = start_target.clone(); let mut current_parent = composite_key(&start_row, parent_cols)?; let mut current_target = start_target; @@ -291,7 +278,7 @@ fn propagate_target_rows( rows, &self_index_all, ¤t_parent, - ¤t_target, + &anchor_target, target_col, kv, )? { @@ -504,7 +491,7 @@ mod tests { } #[test] - fn node_level_self_blocker_prevents_propagation() { + fn node_level_self_blocker_does_not_prevent_propagation() { Python::attach(|py| { let rows: Vec> = vec![ [ @@ -565,7 +552,7 @@ mod tests { .expect("leaf install ts exists") .extract() .expect("leaf install ts string"); - assert_eq!(leaf_install_ts, "3"); + assert_eq!(leaf_install_ts, "1"); }); } @@ -641,6 +628,86 @@ mod tests { assert_eq!(leaf_ts, "7"); }); } + + #[test] + fn blocker_checks_use_start_target_as_anchor_across_ancestors() { + Python::attach(|py| { + let rows: Vec> = vec![ + [ + ("id", "gp"), + ("parent_id", "root"), + ("event", "Install"), + ("kind", "target"), + ("ts", "2022-01-01T00:00:00.000Z"), + ], + [ + ("id", "gp"), + ("parent_id", "root"), + ("event", "Remove"), + ("kind", "other"), + ("ts", "2023-08-01T00:00:00.000Z"), + ], + [ + ("id", "p"), + ("parent_id", "gp"), + ("event", "Other"), + ("kind", "target"), + ("ts", "2023-07-15T12:03:00.000Z"), + ], + [ + ("id", "p"), + ("parent_id", "gp"), + ("event", "Remove"), + ("kind", "other"), + ("ts", "2023-07-15T12:00:00.000Z"), + ], + [ + ("id", "leaf"), + ("parent_id", "p"), + ("event", "Other"), + ("kind", "target"), + ("ts", "2024-02-05T16:30:00.000Z"), + ], + ] + .into_iter() + .map(|pairs| { + let d = PyDict::new(py); + for (k, v) in pairs { + d.set_item(k, v).expect("set test item"); + } + d.unbind() + }) + .collect(); + + let self_cols = vec!["id".to_string()]; + let parent_cols = vec!["parent_id".to_string()]; + let target_key = HashMap::from([("kind".to_string(), "target".to_string())]); + let blocker = HashMap::from([("event".to_string(), "Remove".to_string())]); + + propagate_target_rows( + py, + &rows, + &self_cols, + &parent_cols, + "ts", + &target_key, + Some(&blocker), + "event", + "Install", + Plan::Backward, + ) + .expect("propagation with anchored blocker checks"); + + let leaf_ts: String = rows[4] + .bind(py) + .get_item("ts") + .expect("leaf ts item") + .expect("leaf ts exists") + .extract() + .expect("leaf ts string"); + assert_eq!(leaf_ts, "2022-01-01T00:00:00.000Z"); + }); + } } #[pymodule]