Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/') }}
Expand Down Expand Up @@ -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/') }}
Expand Down Expand Up @@ -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/') }}
Expand All @@ -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/') }}
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/maturin-canary.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set name = "hello-rust" %}
{% set version = "0.1.3" %}
{% set version = "0.1.4" %}

package:
name: {{ name|lower }}
Expand Down
85 changes: 83 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ fn propagate_target_rows(
if !is_valid_target(Some(start_target.clone())) {
continue;
}
let anchor_target = start_target.clone();

let start_self_key = composite_key(&start_row, self_cols)?;
if let Some(kv) = block_key {
Expand All @@ -267,7 +268,7 @@ fn propagate_target_rows(
rows,
&self_index_all,
&start_self_key,
&start_target,
&anchor_target,
target_col,
kv,
)? {
Expand All @@ -291,7 +292,7 @@ fn propagate_target_rows(
rows,
&self_index_all,
&current_parent,
&current_target,
&anchor_target,
target_col,
kv,
)? {
Expand Down Expand Up @@ -641,6 +642,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<Py<PyDict>> = 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]
Expand Down