From fd423ff6be2957a0a34ca9414faf5713ecb671cb Mon Sep 17 00:00:00 2001 From: Saul Shanabrook Date: Thu, 20 Mar 2025 07:26:31 -0400 Subject: [PATCH 1/7] Upgrade rust dependencies --- Cargo.lock | 38 +++++++++++++++++------------------ Cargo.toml | 10 +++++----- rust-toolchain.toml | 2 +- src/conversions.rs | 46 ++++++++++++++++++++++++++++--------------- src/py_object_sort.rs | 27 +++++++++++++------------ src/utils.rs | 44 +++++++++++++++++++++-------------------- 6 files changed, 92 insertions(+), 75 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 721cd785..8a349174 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "aho-corasick" @@ -569,9 +569,9 @@ checksum = "3852614a3bd9ca9804678ba6be5e3b8ce76dfc902cae004e3e0c44051b6e88db" [[package]] name = "log" -version = "0.4.25" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" [[package]] name = "memchr" @@ -749,9 +749,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.22.6" +version = "0.23.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f402062616ab18202ae8319da13fa4279883a2b8a9d9f83f20dbade813ce1884" +checksum = "7778bffd85cf38175ac1f545509665d0b9b92a198ca7941f131f85f7a4f9a872" dependencies = [ "cfg-if", "indoc", @@ -767,9 +767,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.22.6" +version = "0.23.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b14b5775b5ff446dd1056212d778012cbe8a0fbffd368029fd9e25b514479c38" +checksum = "94f6cbe86ef3bf18998d9df6e0f3fc1050a8c5efa409bf712e661a4366e010fb" dependencies = [ "once_cell", "target-lexicon", @@ -777,9 +777,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.22.6" +version = "0.23.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ab5bcf04a2cdcbb50c7d6105de943f543f9ed92af55818fd17b660390fc8636" +checksum = "e9f1b4c431c0bb1c8fb0a338709859eed0d030ff6daa34368d3b152a63dfdd8d" dependencies = [ "libc", "pyo3-build-config", @@ -787,9 +787,9 @@ dependencies = [ [[package]] name = "pyo3-log" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ac84e6eec1159bc2a575c9ae6723baa6ee9d45873e9bebad1e3ad7e8d28a443" +checksum = "be5bb22b77965a7b5394e9aae9897a0607b51df5167561ffc3b02643b4200bc7" dependencies = [ "arc-swap", "log", @@ -798,9 +798,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.22.6" +version = "0.23.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fd24d897903a9e6d80b968368a34e1525aeb719d568dba8b3d4bfa5dc67d453" +checksum = "fbc2201328f63c4710f68abdf653c89d8dbc2858b88c5d88b0ff38a75288a9da" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -810,9 +810,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.22.6" +version = "0.23.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c011a03ba1e50152b4b394b479826cad97e7a21eb52df179cd91ac411cbfbe" +checksum = "fca6726ad0f3da9c9de093d6f116a93c1a38e417ed73bf138472cf4064f72028" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -962,9 +962,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.139" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "indexmap", "itoa", @@ -1119,9 +1119,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.13.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1f41ffb7cf259f1ecc2876861a17e7142e63ead296f671f81f6ae85903e0d6" +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" dependencies = [ "getrandom 0.3.1", ] diff --git a/Cargo.toml b/Cargo.toml index 56cf96af..8cd4332d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,17 +10,17 @@ name = "egglog" crate-type = ["cdylib"] [dependencies] -pyo3 = { version = "0.22.6", features = ["extension-module"] } +pyo3 = { version = "0.23.0", features = ["extension-module"] } egglog = { git = "https://github.com/saulshanabrook/egg-smol", rev = "889ca7635368d7e382e16a93b2883aba82f1078f" } egglog-experimental = { git = "https://github.com/egraphs-good/egglog-experimental", rev = "8a1b3d6ad2723a8438f51f05027161e51f37917c" } egraph-serialize = { version = "0.2.0", features = ["serde", "graphviz"] } -serde_json = "1.0.139" -pyo3-log = "0.11.0" -log = "0.4.25" +serde_json = "1.0.140" +pyo3-log = "0.12.1" +log = "0.4.26" lalrpop-util = { version = "0.22", features = ["lexer"] } ordered-float = "3.7.0" -uuid = { version = "1.13.2", features = ["v4"] } +uuid = { version = "1.16.0", features = ["v4"] } # Use unreleased version of egglog in experimental [patch.'https://github.com/egraphs-good/egglog'] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 628740b1..c1bc0a69 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.79.0" +channel = "1.85.0" diff --git a/src/conversions.rs b/src/conversions.rs index aa097844..2c7a62ab 100644 --- a/src/conversions.rs +++ b/src/conversions.rs @@ -4,7 +4,7 @@ use crate::utils::*; use egglog::ast::Symbol; use ordered_float::OrderedFloat; use pyo3::prelude::*; -use pyo3::types::PyDeltaAccess; +use pyo3::types::{PyDelta, PyDeltaAccess}; use std::collections::HashMap; use std::sync::Arc; @@ -460,9 +460,13 @@ impl FromPyObject<'_> for Box { } } -impl IntoPy for Box { - fn into_py(self, py: Python<'_>) -> PyObject { - (*self).into_py(py) +impl<'py> IntoPyObject<'py> for Box { + type Target = PyAny; // the Python type + type Output = Bound<'py, Self::Target>; // in most cases this will be `Bound` + type Error = pyo3::PyErr; + + fn into_pyobject(self, py: Python<'py>) -> Result { + Ok((*self).into_pyobject(py)?.as_any().clone()) } } @@ -472,9 +476,13 @@ impl FromPyObject<'_> for Box { } } -impl IntoPy for Box { - fn into_py(self, py: Python<'_>) -> PyObject { - (*self).into_py(py) +impl<'py> IntoPyObject<'py> for Box { + type Target = PyAny; // the Python type + type Output = Bound<'py, Self::Target>; // in most cases this will be `Bound` + type Error = pyo3::PyErr; + + fn into_pyobject(self, py: Python<'py>) -> Result { + Ok((*self).into_pyobject(py)?.as_any().clone()) } } @@ -495,9 +503,13 @@ impl FromPyObject<'_> for WrappedOrderedF64 { } } -impl IntoPy for WrappedOrderedF64 { - fn into_py(self, py: Python<'_>) -> PyObject { - self.0.into_inner().into_py(py) +impl<'py> IntoPyObject<'py> for WrappedOrderedF64 { + type Target = PyAny; // the Python type + type Output = Bound<'py, Self::Target>; // in most cases this will be `Bound` + type Error = pyo3::PyErr; + + fn into_pyobject(self, py: Python<'py>) -> Result { + Ok((self.0.into_inner()).into_pyobject(py)?.as_any().clone()) } } @@ -522,11 +534,14 @@ impl FromPyObject<'_> for WrappedDuration { ))) } } +impl<'py> IntoPyObject<'py> for WrappedDuration { + type Target = PyDelta; // the Python type + type Output = Bound<'py, Self::Target>; // in most cases this will be `Bound` + type Error = pyo3::PyErr; -impl IntoPy for WrappedDuration { - fn into_py(self, py: Python<'_>) -> PyObject { + fn into_pyobject(self, py: Python<'py>) -> Result { let d = self.0; - pyo3::types::PyDelta::new_bound( + Ok(pyo3::types::PyDelta::new( py, 0, 0, @@ -534,8 +549,7 @@ impl IntoPy for WrappedDuration { .try_into() .expect("Failed to convert miliseconds to int32 when converting duration"), true, - ) - .expect("Failed to contruct timedelta") - .into() + )? + .clone()) } } diff --git a/src/py_object_sort.rs b/src/py_object_sort.rs index f2bf323c..581582fa 100644 --- a/src/py_object_sort.rs +++ b/src/py_object_sort.rs @@ -10,7 +10,7 @@ use egglog::{ ArcSort, EGraph, PrimitiveLike, Term, TermDag, TypeInfo, Value, }; use pyo3::{ - ffi, intern, prelude::*, types::PyDict, AsPyPointer, IntoPy, PyAny, PyErr, PyObject, PyResult, + ffi, intern, prelude::*, types::PyDict, AsPyPointer, PyAny, PyErr, PyObject, PyResult, PyTraverseError, PyVisit, Python, }; @@ -137,6 +137,7 @@ impl PyObjectSort { } /// Implement wrapper struct so can implement foreign sort on it +#[derive(IntoPyObject, IntoPyObjectRef)] pub struct MyPyObject(pub PyObject); impl FromSort for MyPyObject { @@ -147,12 +148,6 @@ impl FromSort for MyPyObject { } } -impl IntoPy for MyPyObject { - fn into_py(self, _py: Python<'_>) -> PyObject { - self.0 - } -} - #[pyclass(name = "PyObjectSort")] #[derive(Debug, Clone)] pub struct ArcPyObjectSort( @@ -355,9 +350,13 @@ impl PrimitiveLike for Eval { let globals = globals.downcast_bound::(py).unwrap(); let locals = self.py_object.load(py, values[2]); let locals = locals.downcast_bound::(py).unwrap(); - py.eval_bound(code.into(), Some(globals), Some(locals)) - .unwrap() - .into() + py.eval( + CString::new(code.to_string()).unwrap().as_c_str(), + Some(globals), + Some(locals), + ) + .unwrap() + .into() }); Some(self.py_object.store(res_obj)) } @@ -444,7 +443,7 @@ impl PrimitiveLike for Dict { _egraph: Option<&mut EGraph>, ) -> Option { let dict: PyObject = Python::with_gil(|py| { - let dict = PyDict::new_bound(py); + let dict = PyDict::new(py); // Update the dict with the key-value pairs for i in values.chunks_exact(2) { let key = self.py_object.load(py, i[0]); @@ -591,7 +590,8 @@ impl PrimitiveLike for FromString { _egraph: Option<&mut EGraph>, ) -> Option { let str = Symbol::load(self.string.as_ref(), &values[0]).to_string(); - let obj: PyObject = Python::with_gil(|py| str.into_py(py)); + let obj: PyObject = + Python::with_gil(|py| str.into_pyobject(py).unwrap().as_any().clone().unbind()); Some(self.py_object.store(obj)) } } @@ -624,7 +624,8 @@ impl PrimitiveLike for FromInt { _egraph: Option<&mut EGraph>, ) -> Option { let int = i64::load(self.int.as_ref(), &values[0]); - let obj: PyObject = Python::with_gil(|py| int.into_py(py)); + let obj: PyObject = + Python::with_gil(|py| int.into_pyobject(py).unwrap().as_any().clone().unbind()); Some(self.py_object.store(obj)) } } diff --git a/src/utils.rs b/src/utils.rs index 7a77455c..79ba576b 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -7,16 +7,14 @@ pub fn data_repr( slf: PyRef, field_names: Vec<&str>, ) -> PyResult { - let obj = slf.into_py(py); - let class_name: String = obj - .getattr(py, "__class__")? - .getattr(py, "__name__")? - .extract(py)?; + let binding = slf.into_pyobject(py)?; + let obj = binding.as_any(); + let class_name: String = obj.getattr("__class__")?.getattr("__name__")?.extract()?; let field_strings: PyResult> = field_names .iter() .map(|name| { - obj.getattr(py, *name) - .and_then(|x| x.call_method_bound(py, "__repr__", (), None)?.extract(py)) + obj.getattr(*name) + .and_then(|x| x.call_method("__repr__", (), None)?.extract()) }) .collect(); Ok(format!("{}({})", class_name, field_strings?.join(", "))) @@ -64,11 +62,11 @@ macro_rules! convert_enums { fn __str__(&self) -> String { format!($str, <$from_type>::from(self.clone())) } - fn __richcmp__(&self, other: &Self, op: pyo3::basic::CompareOp, py: Python<'_>) -> PyObject { + fn __richcmp__(&self, other: &Self, op: pyo3::basic::CompareOp, py: Python<'_>) -> PyResult { match op { - pyo3::basic::CompareOp::Eq => (self == other).into_py(py), - pyo3::basic::CompareOp::Ne => (self != other).into_py(py), - _ => py.NotImplemented(), + pyo3::basic::CompareOp::Eq => Ok((self == other).into_pyobject(py)?.as_any().clone().unbind()), + pyo3::basic::CompareOp::Ne => Ok((self != other).into_pyobject(py)?.as_any().clone().unbind()), + _ => Ok(py.NotImplemented()), } } } @@ -91,13 +89,17 @@ macro_rules! convert_enums { $variant($variant), )* } - impl IntoPy for $to_type { - fn into_py(self, py: Python<'_>) -> PyObject { - match self { + impl<'py> IntoPyObject<'py> for $to_type { + type Target = PyAny; // the Python type + type Output = Bound<'py, Self::Target>; // in most cases this will be `Bound` + type Error = pyo3::PyErr; + + fn into_pyobject(self, py: Python<'py>) -> Result, Self::Error> { + Ok(match self { $( - $to_type::$variant(v) => v.into_py(py), + $to_type::$variant(v) => v.into_pyobject(py)?.as_any().clone(), )* - } + }) } } impl From<$to_type> for $from_type { @@ -203,12 +205,12 @@ macro_rules! convert_struct { fn __str__(&self) -> String { format!($str, <$from_type>::from(self.clone())) } - fn __richcmp__(&self, other: &Self, op: pyo3::basic::CompareOp, py: Python<'_>) -> PyObject { - match op { - pyo3::basic::CompareOp::Eq => (self == other).into_py(py), - pyo3::basic::CompareOp::Ne => (self != other).into_py(py), + fn __richcmp__(&self, other: &Self, op: pyo3::basic::CompareOp, py: Python<'_>) -> PyResult { + Ok(match op { + pyo3::basic::CompareOp::Eq => (self == other).into_pyobject(py)?.as_any().clone().unbind(), + pyo3::basic::CompareOp::Ne => (self != other).into_pyobject(py)?.as_any().clone().unbind(), _ => py.NotImplemented(), - } + }) } } From 7548412c0102588b2c43e0a5599506809377c8fe Mon Sep 17 00:00:00 2001 From: Saul Shanabrook Date: Thu, 20 Mar 2025 07:37:00 -0400 Subject: [PATCH 2/7] Try always runnings builds to pick up errors earlier --- .github/workflows/version.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index e7a5f121..cdb533d8 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -11,6 +11,10 @@ # This seperates the release process from the test process, so we can still release if we need to and tests are failing name: Bump Version on: + push: + branches: + - main + pull_request: workflow_dispatch: inputs: type: @@ -27,6 +31,7 @@ jobs: bump: runs-on: ubuntu-latest permissions: write-all + if: github.event_name == 'workflow_dispatch' outputs: version: ${{ steps.bump.outputs.version }} steps: @@ -52,10 +57,14 @@ jobs: matrix: target: [aarch64, ppc64] needs: [bump] + if: ${{ always() }} steps: - uses: actions/checkout@v4 + if: ${{ needs.bump.result == 'success' }} with: ref: version-${{ needs.bump.outputs.version }} + - uses: actions/checkout@v4 + if: ${{ needs.bump.result == 'skipped' }} - uses: PyO3/maturin-action@v1.47.0 with: target: ${{ matrix.target }} @@ -72,10 +81,14 @@ jobs: name: build linux runs-on: ubuntu-latest needs: [bump] + if: ${{ always() }} steps: - uses: actions/checkout@v4 + if: ${{ needs.bump.result == 'success' }} with: ref: version-${{ needs.bump.outputs.version }} + - uses: actions/checkout@v4 + if: ${{ needs.bump.result == 'skipped' }} - name: Setup QEMU uses: docker/setup-qemu-action@v3 - uses: PyO3/maturin-action@v1.47.0 @@ -93,10 +106,14 @@ jobs: name: build windows runs-on: windows-latest needs: [bump] + if: ${{ always() }} steps: - uses: actions/checkout@v4 + if: ${{ needs.bump.result == 'success' }} with: ref: version-${{ needs.bump.outputs.version }} + - uses: actions/checkout@v4 + if: ${{ needs.bump.result == 'skipped' }} - uses: PyO3/maturin-action@v1.47.0 with: command: build @@ -111,10 +128,14 @@ jobs: name: build macos runs-on: macos-latest needs: [bump] + if: ${{ always() }} steps: - uses: actions/checkout@v4 + if: ${{ needs.bump.result == 'success' }} with: ref: version-${{ needs.bump.outputs.version }} + - uses: actions/checkout@v4 + if: ${{ needs.bump.result == 'skipped' }} - uses: PyO3/maturin-action@v1.47.0 with: command: build @@ -130,7 +151,7 @@ jobs: name: Release runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch') - needs: [macos, windows, linux, linux-cross] + needs: [macos, windows, linux, linux-cross, bump] steps: - uses: actions/download-artifact@v4 with: From b0e84b2e5f74872c870f516d1788e0e137f34d5f Mon Sep 17 00:00:00 2001 From: Saul Shanabrook Date: Thu, 20 Mar 2025 07:43:09 -0400 Subject: [PATCH 3/7] pre-commit updates --- .pre-commit-config.yaml | 4 ++-- pyproject.toml | 6 ++---- python/egglog/functionalize.py | 2 +- python/egglog/runtime.py | 2 +- python/tests/test_program_gen.py | 8 +++++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 57517d17..52a45a49 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,13 +1,13 @@ exclude: ^python/tests/__snapshots__/ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.3 + rev: v0.11.0 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - id: ruff-format - repo: https://github.com/astral-sh/uv-pre-commit # uv version. - rev: 0.5.31 + rev: 0.6.8 hooks: - id: uv-lock diff --git a/pyproject.toml b/pyproject.toml index bd08f40d..0447b0df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,10 +89,8 @@ ignore = [ # allow star imports "F405", "F403", - # Dont care if cls isnt typed explicitly in classmethod - "ANN102", - # Same for self - "ANN101", + # allow shadow builtin import + "A004", # Allow single line docstrings on multiple lines "D200", "D212", diff --git a/python/egglog/functionalize.py b/python/egglog/functionalize.py index df2e891c..133048f6 100644 --- a/python/egglog/functionalize.py +++ b/python/egglog/functionalize.py @@ -88,4 +88,4 @@ def wrapper(*args): wrapper.__name__ = f.__name__ # Partially apply the wrapper function with the current values of the free vars - return cast(T, partial(wrapper, *(v for _, _, v, _ in additional_arg_filtered))) + return cast("T", partial(wrapper, *(v for _, _, v, _ in additional_arg_filtered))) diff --git a/python/egglog/runtime.py b/python/egglog/runtime.py index 6aba3484..b5404695 100644 --- a/python/egglog/runtime.py +++ b/python/egglog/runtime.py @@ -286,7 +286,7 @@ def __hash__(self) -> int: return hash((id(self.__egg_decls_thunk__), self.__egg_tp__)) # Support unioning like types - def __or__(self, __value: type) -> object: + def __or__(self, *, __value: type) -> object: return Union[self, __value] # noqa: UP007 @property diff --git a/python/tests/test_program_gen.py b/python/tests/test_program_gen.py index af503e49..10acbfb5 100644 --- a/python/tests/test_program_gen.py +++ b/python/tests/test_program_gen.py @@ -2,12 +2,14 @@ from __future__ import annotations import inspect -from types import FunctionType -from typing import cast +from typing import TYPE_CHECKING, cast from egglog import * from egglog.exp.program_gen import * +if TYPE_CHECKING: + from types import FunctionType + class Math(Expr): def __init__(self, value: i64Like) -> None: ... @@ -85,6 +87,6 @@ def test_py_object(): egraph.register(evalled) egraph.run((to_program_ruleset | eval_program_rulseset | program_gen_ruleset).saturate()) with egraph.set_current(): - res = cast(FunctionType, evalled.as_py_object.eval()) + res = cast("FunctionType", evalled.as_py_object.eval()) assert res(1, 2) == 13 assert inspect.getsource(res) From 410a2af36e801c8f1d1aa6034cfffe76842dfadb Mon Sep 17 00:00:00 2001 From: Saul Shanabrook Date: Thu, 20 Mar 2025 07:45:24 -0400 Subject: [PATCH 4/7] fix linux wheel upload name --- .github/workflows/version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index dcb6b724..ea7b37fa 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -74,7 +74,7 @@ jobs: - name: Upload wheels uses: actions/upload-artifact@v4 with: - name: wheels-linux + name: wheels-linux-${{ matrix.target }} path: dist linux: From 697948c78294bc6debf78ea6d1721e74b7d806f7 Mon Sep 17 00:00:00 2001 From: Saul Shanabrook Date: Thu, 20 Mar 2025 07:46:59 -0400 Subject: [PATCH 5/7] make github actions versions only minor release to update less --- .github/workflows/CI.yml | 8 ++++---- .github/workflows/version.yml | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7468e086..e9021d8f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -29,7 +29,7 @@ jobs: - uses: astral-sh/setup-uv@v5 with: enable-cache: true - - uses: dtolnay/rust-toolchain@1.79.0 + - uses: dtolnay/rust-toolchain@1.79 - uses: Swatinem/rust-cache@v2 - name: Setup python ${{ matrix.py }} uses: actions/setup-python@v5 @@ -45,7 +45,7 @@ jobs: - uses: astral-sh/setup-uv@v5 with: enable-cache: true - - uses: dtolnay/rust-toolchain@1.79.0 + - uses: dtolnay/rust-toolchain@1.79 - uses: Swatinem/rust-cache@v2 - uses: actions/setup-python@v5 with: @@ -62,7 +62,7 @@ jobs: - uses: astral-sh/setup-uv@v5 with: enable-cache: true - - uses: dtolnay/rust-toolchain@1.79.0 + - uses: dtolnay/rust-toolchain@1.79 - uses: Swatinem/rust-cache@v2 - uses: actions/setup-python@v5 with: @@ -81,7 +81,7 @@ jobs: - uses: astral-sh/setup-uv@v5 with: enable-cache: true - - uses: dtolnay/rust-toolchain@1.79.0 + - uses: dtolnay/rust-toolchain@1.79 - uses: Swatinem/rust-cache@v2 - uses: actions/setup-python@v5 with: diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index ea7b37fa..10b0856b 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -65,7 +65,7 @@ jobs: ref: version-${{ needs.bump.outputs.version }} - uses: actions/checkout@v4 if: ${{ needs.bump.result == 'skipped' }} - - uses: PyO3/maturin-action@v1.47.1 + - uses: PyO3/maturin-action@v1.47 with: target: ${{ matrix.target }} manylinux: auto @@ -91,7 +91,7 @@ jobs: if: ${{ needs.bump.result == 'skipped' }} - name: Setup QEMU uses: docker/setup-qemu-action@v3 - - uses: PyO3/maturin-action@v1.47.1 + - uses: PyO3/maturin-action@v1.47 with: manylinux: auto command: build @@ -114,7 +114,7 @@ jobs: ref: version-${{ needs.bump.outputs.version }} - uses: actions/checkout@v4 if: ${{ needs.bump.result == 'skipped' }} - - uses: PyO3/maturin-action@v1.47.1 + - uses: PyO3/maturin-action@v1.47 with: command: build args: --release -o dist --find-interpreter @@ -136,7 +136,7 @@ jobs: ref: version-${{ needs.bump.outputs.version }} - uses: actions/checkout@v4 if: ${{ needs.bump.result == 'skipped' }} - - uses: PyO3/maturin-action@v1.47.1 + - uses: PyO3/maturin-action@v1.47 with: command: build target: universal2-apple-darwin @@ -158,7 +158,7 @@ jobs: pattern: wheels-* merge-multiple: true - name: Publish to PyPI - uses: PyO3/maturin-action@v1.47.1 + uses: PyO3/maturin-action@v1.47 env: MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} with: From 71b23816c81b112adb660957789ddb9d17023032 Mon Sep 17 00:00:00 2001 From: Saul Shanabrook Date: Thu, 20 Mar 2025 07:47:52 -0400 Subject: [PATCH 6/7] Fix or --- python/egglog/runtime.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/egglog/runtime.py b/python/egglog/runtime.py index b5404695..a2ee31ac 100644 --- a/python/egglog/runtime.py +++ b/python/egglog/runtime.py @@ -286,8 +286,8 @@ def __hash__(self) -> int: return hash((id(self.__egg_decls_thunk__), self.__egg_tp__)) # Support unioning like types - def __or__(self, *, __value: type) -> object: - return Union[self, __value] # noqa: UP007 + def __or__(self, value: type) -> object: + return Union[self, value] # noqa: UP007 @property def __parameters__(self) -> tuple[object, ...]: From 1b38778c2759b87e602fc3004de81d86925968a4 Mon Sep 17 00:00:00 2001 From: Saul Shanabrook Date: Thu, 20 Mar 2025 07:48:56 -0400 Subject: [PATCH 7/7] Revert "make github actions versions only minor release to update less" 697948c78294bc6debf78ea6d1721e74b7d806f7 --- .github/workflows/CI.yml | 8 ++++---- .github/workflows/version.yml | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e9021d8f..7468e086 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -29,7 +29,7 @@ jobs: - uses: astral-sh/setup-uv@v5 with: enable-cache: true - - uses: dtolnay/rust-toolchain@1.79 + - uses: dtolnay/rust-toolchain@1.79.0 - uses: Swatinem/rust-cache@v2 - name: Setup python ${{ matrix.py }} uses: actions/setup-python@v5 @@ -45,7 +45,7 @@ jobs: - uses: astral-sh/setup-uv@v5 with: enable-cache: true - - uses: dtolnay/rust-toolchain@1.79 + - uses: dtolnay/rust-toolchain@1.79.0 - uses: Swatinem/rust-cache@v2 - uses: actions/setup-python@v5 with: @@ -62,7 +62,7 @@ jobs: - uses: astral-sh/setup-uv@v5 with: enable-cache: true - - uses: dtolnay/rust-toolchain@1.79 + - uses: dtolnay/rust-toolchain@1.79.0 - uses: Swatinem/rust-cache@v2 - uses: actions/setup-python@v5 with: @@ -81,7 +81,7 @@ jobs: - uses: astral-sh/setup-uv@v5 with: enable-cache: true - - uses: dtolnay/rust-toolchain@1.79 + - uses: dtolnay/rust-toolchain@1.79.0 - uses: Swatinem/rust-cache@v2 - uses: actions/setup-python@v5 with: diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index 10b0856b..ea7b37fa 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -65,7 +65,7 @@ jobs: ref: version-${{ needs.bump.outputs.version }} - uses: actions/checkout@v4 if: ${{ needs.bump.result == 'skipped' }} - - uses: PyO3/maturin-action@v1.47 + - uses: PyO3/maturin-action@v1.47.1 with: target: ${{ matrix.target }} manylinux: auto @@ -91,7 +91,7 @@ jobs: if: ${{ needs.bump.result == 'skipped' }} - name: Setup QEMU uses: docker/setup-qemu-action@v3 - - uses: PyO3/maturin-action@v1.47 + - uses: PyO3/maturin-action@v1.47.1 with: manylinux: auto command: build @@ -114,7 +114,7 @@ jobs: ref: version-${{ needs.bump.outputs.version }} - uses: actions/checkout@v4 if: ${{ needs.bump.result == 'skipped' }} - - uses: PyO3/maturin-action@v1.47 + - uses: PyO3/maturin-action@v1.47.1 with: command: build args: --release -o dist --find-interpreter @@ -136,7 +136,7 @@ jobs: ref: version-${{ needs.bump.outputs.version }} - uses: actions/checkout@v4 if: ${{ needs.bump.result == 'skipped' }} - - uses: PyO3/maturin-action@v1.47 + - uses: PyO3/maturin-action@v1.47.1 with: command: build target: universal2-apple-darwin @@ -158,7 +158,7 @@ jobs: pattern: wheels-* merge-multiple: true - name: Publish to PyPI - uses: PyO3/maturin-action@v1.47 + uses: PyO3/maturin-action@v1.47.1 env: MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} with: