diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 17a3e87a19cbd..51ae6470be188 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -69,7 +69,7 @@ jobs: strategy: matrix: node-version: [16] - python-version: ["3.9", "3.10", "3.11", "fallback"] + python-version: ["3.9", "3.10", "3.11", "3.12", "fallback"] target: ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu"] include: - target: x86_64-unknown-linux-gnu @@ -170,7 +170,7 @@ jobs: node-version: [16.x] os-version: ["macos-11"] target: ["x86_64-apple-darwin", "aarch64-apple-darwin"] - python-version: ["3.9", "3.10", "3.11", "fallback"] + python-version: ["3.9", "3.10", "3.11", "3.12", "fallback"] include: - target: x86_64-apple-darwin package_target_arch: x64 @@ -190,6 +190,8 @@ jobs: python-version: "3.10" - target: "aarch64-apple-darwin" python-version: "3.11" + - target: "aarch64-apple-darwin" + python-version: "3.12" fail-fast: false steps: diff --git a/.github/workflows/rust-cubesql.yml b/.github/workflows/rust-cubesql.yml index 2f3da030b1869..ada8c69ec0555 100644 --- a/.github/workflows/rust-cubesql.yml +++ b/.github/workflows/rust-cubesql.yml @@ -130,7 +130,7 @@ jobs: matrix: # Current used version + 1 LTS node-version: [16, 18] - python-version: ["3.9", "3.10", "3.11", "fallback"] + python-version: ["3.9", "3.10", "3.11", "3.12", "fallback"] target: ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu"] # minimize number of jobs exclude: @@ -138,6 +138,8 @@ jobs: target: "aarch64-unknown-linux-gnu" - python-version: 3.10 target: "aarch64-unknown-linux-gnu" + - python-version: 3.11 + target: "aarch64-unknown-linux-gnu" fail-fast: false container: image: cubejs/rust-cross:${{ matrix.target }}-30052023 @@ -238,6 +240,8 @@ jobs: python-version: "3.10" - target: x86_64-apple-darwin python-version: "3.11" + - target: x86_64-apple-darwin + python-version: "3.12" - target: x86_64-apple-darwin python-version: "fallback" - target: aarch64-apple-darwin diff --git a/packages/cubejs-backend-native/Cargo.lock b/packages/cubejs-backend-native/Cargo.lock index 2b798c27d2e64..05c843a36a9f7 100644 --- a/packages/cubejs-backend-native/Cargo.lock +++ b/packages/cubejs-backend-native/Cargo.lock @@ -1524,9 +1524,9 @@ dependencies = [ [[package]] name = "indoc" -version = "1.0.9" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa799dd5ed20a7e349f3b4639aa80d74549c81716d9ec4f994c9b5815598306" +checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8" [[package]] name = "instant" @@ -2532,9 +2532,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.19.2" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e681a6cfdc4adcc93b4d3cf993749a4552018ee0a9b65fc0ccfad74352c72a38" +checksum = "04e8453b658fe480c3e70c8ed4e3d3ec33eb74988bd186561b0cc66b85c3bc4b" dependencies = [ "cfg-if 1.0.0", "indoc", @@ -2549,9 +2549,9 @@ dependencies = [ [[package]] name = "pyo3-asyncio" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2cc34c1f907ca090d7add03dc523acdd91f3a4dab12286604951e2f5152edad" +checksum = "6ea6b68e93db3622f3bb3bf363246cf948ed5375afe7abff98ccbdd50b184995" dependencies = [ "futures", "once_cell", @@ -2563,9 +2563,9 @@ dependencies = [ [[package]] name = "pyo3-asyncio-macros" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4045f06429547179e4596f5c0b13c82efc8b04296016780133653ed69ce26b3" +checksum = "56c467178e1da6252c95c29ecf898b133f742e9181dca5def15dc24e19d45a39" dependencies = [ "proc-macro2", "quote", @@ -2574,9 +2574,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.19.2" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076c73d0bc438f7a4ef6fdd0c3bb4732149136abd952b110ac93e4edb13a6ba5" +checksum = "a96fe70b176a89cff78f2fa7b3c930081e163d5379b4dcdf993e3ae29ca662e5" dependencies = [ "once_cell", "target-lexicon", @@ -2584,9 +2584,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.19.2" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e53cee42e77ebe256066ba8aa77eff722b3bb91f3419177cf4cd0f304d3284d9" +checksum = "214929900fd25e6604661ed9cf349727c8920d47deff196c4e28165a6ef2a96b" dependencies = [ "libc", "pyo3-build-config", @@ -2594,25 +2594,26 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.19.2" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfeb4c99597e136528c6dd7d5e3de5434d1ceaf487436a3f03b2d56b6fc9efd1" +checksum = "dac53072f717aa1bfa4db832b39de8c875b7c7af4f4a6fe93cdbf9264cf8383b" dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 1.0.109", + "syn 2.0.41", ] [[package]] name = "pyo3-macros-backend" -version = "0.19.2" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "947dc12175c254889edc0c02e399476c2f652b4b9ebd123aa655c224de259536" +checksum = "7774b5a8282bd4f25f803b1f0d945120be959a36c72e08e7cd031c792fdfd424" dependencies = [ + "heck 0.4.1", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.41", ] [[package]] @@ -3894,9 +3895,9 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "unindent" -version = "0.1.11" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1766d682d402817b5ac4490b3c3002d91dfa0d22812f341609f97b08757359c" +checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce" [[package]] name = "untrusted" diff --git a/packages/cubejs-backend-native/Cargo.toml b/packages/cubejs-backend-native/Cargo.toml index 0b93d3fb9d0dc..4c1c64453b7cc 100644 --- a/packages/cubejs-backend-native/Cargo.toml +++ b/packages/cubejs-backend-native/Cargo.toml @@ -31,8 +31,8 @@ convert_case = "0.6.0" minijinja = { version = "1", features = ["json", "loader"] } log-reroute = "0.1" # python -pyo3 = { version = "0.19", features = [], optional = true } -pyo3-asyncio = { version = "0.19", features = ["tokio-runtime", "attributes"], optional = true } +pyo3 = { version = "0.20.0", features = [], optional = true } +pyo3-asyncio = { version = "0.20.0", features = ["tokio-runtime", "attributes"], optional = true } [dependencies.neon] version = "=0.10.1" diff --git a/packages/cubejs-backend-native/README.md b/packages/cubejs-backend-native/README.md index 5ed364552b7b5..81e5d2a4724e9 100644 --- a/packages/cubejs-backend-native/README.md +++ b/packages/cubejs-backend-native/README.md @@ -21,21 +21,21 @@ If Cube cannot detect a `libpython` library or your system is not supported, it ### With python -Supported python versions: `3.11`, `3.10`, `3.9`. +Supported python versions: `3.12`, `3.11`, `3.10`, `3.9`. -| | `linux-gnu` | `linux-musl` | `darwin` | `win32` | -| -------- |:---------------:|:----------------:|:-----------:|:-------------:| -| `x86` | N/A | N/A | N/A | N/A | -| `x86_64` | ✅ | N/A | N/A | N/A | -| `arm64` | N/A | N/A | N/A | N/A | +| | `linux-gnu` | `linux-musl` | `darwin` | `win32` | +|----------|:-----------:|:------------:|:--------:|:-------:| +| `x86` | N/A | N/A | N/A | N/A | +| `x86_64` | ✅ | N/A | N/A | N/A | +| `arm64` | ✅ | N/A | N/A | N/A | ### Fallback (without python) -| | `linux-gnu` | `linux-musl` | `darwin` | `win32` | -| -------- | :---------: |:-------------:|:--------:| :-----: | -| `x86` | N/A | N/A | N/A | N/A | -| `x86_64` | ✅ | N/A | ✅ | ✅ | -| `arm64` | ✅ | N/A | ✅ | | +| | `linux-gnu` | `linux-musl` | `darwin` | `win32` | +|----------|:-----------:|:------------:|:--------:|:-------:| +| `x86` | N/A | N/A | N/A | N/A | +| `x86_64` | ✅ | N/A | ✅ | ✅ | +| `arm64` | ✅ | N/A | ✅ | | ### License diff --git a/packages/cubejs-backend-native/package.json b/packages/cubejs-backend-native/package.json index 6ca8baab08445..f901116d46d95 100644 --- a/packages/cubejs-backend-native/package.json +++ b/packages/cubejs-backend-native/package.json @@ -53,6 +53,7 @@ "value": [ "libpython", [ + "3.12", "3.11", "3.10", "3.9" diff --git a/packages/cubejs-backend-native/src/cross/clrepr_python.rs b/packages/cubejs-backend-native/src/cross/clrepr_python.rs index 6f959e6b0a869..bc7810cef9e5b 100644 --- a/packages/cubejs-backend-native/src/cross/clrepr_python.rs +++ b/packages/cubejs-backend-native/src/cross/clrepr_python.rs @@ -5,7 +5,7 @@ use pyo3::types::{ PyBool, PyComplex, PyDate, PyDict, PyFloat, PyFrame, PyFunction, PyInt, PyList, PySequence, PySet, PyString, PyTraceback, PyTuple, }; -use pyo3::{AsPyPointer, Py, PyAny, PyErr, PyObject, Python, ToPyObject}; +use pyo3::{Py, PyAny, PyErr, PyObject, Python, ToPyObject}; #[derive(Debug, Clone)] pub enum PythonRef { diff --git a/packages/cubejs-backend-native/src/cross/mod.rs b/packages/cubejs-backend-native/src/cross/mod.rs index 88ffa374b4f78..39c4ad999e003 100644 --- a/packages/cubejs-backend-native/src/cross/mod.rs +++ b/packages/cubejs-backend-native/src/cross/mod.rs @@ -8,5 +8,3 @@ pub use clrepr::{CLRepr, CLReprKind, CLReprObject, StringType}; #[cfg(feature = "python")] pub use clrepr_python::{CLReprPython, PythonRef}; -#[cfg(feature = "python")] -pub use py_in_js::{BoxedJsPyFunctionWrapper, JsPyFunctionWrapper}; diff --git a/packages/cubejs-backend-native/src/python/runtime.rs b/packages/cubejs-backend-native/src/python/runtime.rs index 8f9c992e26c2a..7836eca591c21 100644 --- a/packages/cubejs-backend-native/src/python/runtime.rs +++ b/packages/cubejs-backend-native/src/python/runtime.rs @@ -8,7 +8,6 @@ use neon::types::Deferred; use once_cell::sync::OnceCell; use pyo3::prelude::*; use pyo3::types::{PyFunction, PyTuple}; -use pyo3::AsPyPointer; use std::fmt::Formatter; use std::future::Future; use std::pin::Pin; diff --git a/packages/cubejs-backend-native/src/python/utils.rs b/packages/cubejs-backend-native/src/python/utils.rs index 8f99d2d835dbe..ea740a0422715 100644 --- a/packages/cubejs-backend-native/src/python/utils.rs +++ b/packages/cubejs-backend-native/src/python/utils.rs @@ -2,7 +2,6 @@ use crate::cross::*; use pyo3::exceptions::PyNotImplementedError; use pyo3::prelude::*; use pyo3::types::{PyFunction, PyString, PyTuple}; -use pyo3::AsPyPointer; pub fn python_fn_call_sync(py_fun: &Py, arguments: Vec) -> PyResult { Python::with_gil(|py| {