Skip to content

Commit aa892d8

Browse files
fmt
1 parent 8ebfd8c commit aa892d8

3 files changed

Lines changed: 19 additions & 24 deletions

File tree

.github/workflows/pipeline-tests.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,20 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v5
13+
- uses: actions/checkout@v6
1414

1515
- name: Set up Python
1616
uses: actions/setup-python@v6
1717
with:
1818
python-version: 3.x
1919

20-
- name: Install uv
21-
uses: astral-sh/setup-uv@v6
22-
with:
23-
version: "latest"
20+
- name: Set up uv
21+
uses: astral-sh/setup-uv@v7
2422

2523
- name: Install dependencies
2624
run: |
2725
uv sync
2826
2927
- name: Run tests
3028
run: |
31-
uv run pytest -v
29+
uv run pytest cloudcheck_update/test_cloudcheck_update.py -v

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,3 @@ mod tests {
192192
);
193193
}
194194
}
195-

src/python.rs

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
use crate::CloudCheck as RustCloudCheck;
12
use pyo3::prelude::*;
23
use pyo3::types::PyDict;
3-
use crate::CloudCheck as RustCloudCheck;
44

55
#[pymodule]
66
fn cloudcheck(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
@@ -27,23 +27,21 @@ impl CloudCheck {
2727
let target = target.to_string();
2828
pyo3_async_runtimes::tokio::future_into_py(py, async move {
2929
match inner.lookup(&target).await {
30-
Ok(providers) => {
31-
Python::attach(|py| -> PyResult<Vec<Py<PyAny>>> {
32-
let mut result = Vec::new();
33-
for provider in providers {
34-
let dict = PyDict::new(py);
35-
dict.set_item("name", provider.name)?;
36-
dict.set_item("tags", provider.tags)?;
37-
result.push(dict.unbind().into());
38-
}
39-
Ok(result)
40-
})
41-
}
42-
Err(e) => Err(PyErr::new::<pyo3::exceptions::PyRuntimeError, _>(
43-
format!("CloudCheck error: {}", e),
44-
)),
30+
Ok(providers) => Python::attach(|py| -> PyResult<Vec<Py<PyAny>>> {
31+
let mut result = Vec::new();
32+
for provider in providers {
33+
let dict = PyDict::new(py);
34+
dict.set_item("name", provider.name)?;
35+
dict.set_item("tags", provider.tags)?;
36+
result.push(dict.unbind().into());
37+
}
38+
Ok(result)
39+
}),
40+
Err(e) => Err(PyErr::new::<pyo3::exceptions::PyRuntimeError, _>(format!(
41+
"CloudCheck error: {}",
42+
e
43+
))),
4544
}
4645
})
4746
}
4847
}
49-

0 commit comments

Comments
 (0)