Skip to content

Commit 618a81e

Browse files
authored
feat(native): Support Python 3.12 (#7550)
1 parent 7a01dcd commit 618a81e

File tree

10 files changed

+45
-41
lines changed

10 files changed

+45
-41
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
strategy:
7070
matrix:
7171
node-version: [16]
72-
python-version: ["3.9", "3.10", "3.11", "fallback"]
72+
python-version: ["3.9", "3.10", "3.11", "3.12", "fallback"]
7373
target: ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu"]
7474
include:
7575
- target: x86_64-unknown-linux-gnu
@@ -170,7 +170,7 @@ jobs:
170170
node-version: [16.x]
171171
os-version: ["macos-11"]
172172
target: ["x86_64-apple-darwin", "aarch64-apple-darwin"]
173-
python-version: ["3.9", "3.10", "3.11", "fallback"]
173+
python-version: ["3.9", "3.10", "3.11", "3.12", "fallback"]
174174
include:
175175
- target: x86_64-apple-darwin
176176
package_target_arch: x64
@@ -190,6 +190,8 @@ jobs:
190190
python-version: "3.10"
191191
- target: "aarch64-apple-darwin"
192192
python-version: "3.11"
193+
- target: "aarch64-apple-darwin"
194+
python-version: "3.12"
193195
fail-fast: false
194196

195197
steps:

.github/workflows/rust-cubesql.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,16 @@ jobs:
130130
matrix:
131131
# Current used version + 1 LTS
132132
node-version: [16, 18]
133-
python-version: ["3.9", "3.10", "3.11", "fallback"]
133+
python-version: ["3.9", "3.10", "3.11", "3.12", "fallback"]
134134
target: ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu"]
135135
# minimize number of jobs
136136
exclude:
137137
- node-version: 18
138138
target: "aarch64-unknown-linux-gnu"
139139
- python-version: 3.10
140140
target: "aarch64-unknown-linux-gnu"
141+
- python-version: 3.11
142+
target: "aarch64-unknown-linux-gnu"
141143
fail-fast: false
142144
container:
143145
image: cubejs/rust-cross:${{ matrix.target }}-30052023
@@ -238,6 +240,8 @@ jobs:
238240
python-version: "3.10"
239241
- target: x86_64-apple-darwin
240242
python-version: "3.11"
243+
- target: x86_64-apple-darwin
244+
python-version: "3.12"
241245
- target: x86_64-apple-darwin
242246
python-version: "fallback"
243247
- target: aarch64-apple-darwin

packages/cubejs-backend-native/Cargo.lock

Lines changed: 21 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cubejs-backend-native/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ convert_case = "0.6.0"
3131
minijinja = { version = "1", features = ["json", "loader"] }
3232
log-reroute = "0.1"
3333
# python
34-
pyo3 = { version = "0.19", features = [], optional = true }
35-
pyo3-asyncio = { version = "0.19", features = ["tokio-runtime", "attributes"], optional = true }
34+
pyo3 = { version = "0.20.0", features = [], optional = true }
35+
pyo3-asyncio = { version = "0.20.0", features = ["tokio-runtime", "attributes"], optional = true }
3636

3737
[dependencies.neon]
3838
version = "=0.10.1"

packages/cubejs-backend-native/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@ If Cube cannot detect a `libpython` library or your system is not supported, it
2121

2222
### With python
2323

24-
Supported python versions: `3.11`, `3.10`, `3.9`.
24+
Supported python versions: `3.12`, `3.11`, `3.10`, `3.9`.
2525

26-
| | `linux-gnu` | `linux-musl` | `darwin` | `win32` |
27-
| -------- |:---------------:|:----------------:|:-----------:|:-------------:|
28-
| `x86` | N/A | N/A | N/A | N/A |
29-
| `x86_64` | | N/A | N/A | N/A |
30-
| `arm64` | N/A | N/A | N/A | N/A |
26+
| | `linux-gnu` | `linux-musl` | `darwin` | `win32` |
27+
|----------|:-----------:|:------------:|:--------:|:-------:|
28+
| `x86` | N/A | N/A | N/A | N/A |
29+
| `x86_64` || N/A | N/A | N/A |
30+
| `arm64` | | N/A | N/A | N/A |
3131

3232
### Fallback (without python)
3333

34-
| | `linux-gnu` | `linux-musl` | `darwin` | `win32` |
35-
| -------- | :---------: |:-------------:|:--------:| :-----: |
36-
| `x86` | N/A | N/A | N/A | N/A |
37-
| `x86_64` || N/A |||
38-
| `arm64` || N/A || |
34+
| | `linux-gnu` | `linux-musl` | `darwin` | `win32` |
35+
|----------|:-----------:|:------------:|:--------:|:-------:|
36+
| `x86` | N/A | N/A | N/A | N/A |
37+
| `x86_64` | | N/A || |
38+
| `arm64` | | N/A || |
3939

4040
### License
4141

packages/cubejs-backend-native/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"value": [
5454
"libpython",
5555
[
56+
"3.12",
5657
"3.11",
5758
"3.10",
5859
"3.9"

packages/cubejs-backend-native/src/cross/clrepr_python.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use pyo3::types::{
55
PyBool, PyComplex, PyDate, PyDict, PyFloat, PyFrame, PyFunction, PyInt, PyList, PySequence,
66
PySet, PyString, PyTraceback, PyTuple,
77
};
8-
use pyo3::{AsPyPointer, Py, PyAny, PyErr, PyObject, Python, ToPyObject};
8+
use pyo3::{Py, PyAny, PyErr, PyObject, Python, ToPyObject};
99

1010
#[derive(Debug, Clone)]
1111
pub enum PythonRef {

packages/cubejs-backend-native/src/cross/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,3 @@ pub use clrepr::{CLRepr, CLReprKind, CLReprObject, StringType};
88

99
#[cfg(feature = "python")]
1010
pub use clrepr_python::{CLReprPython, PythonRef};
11-
#[cfg(feature = "python")]
12-
pub use py_in_js::{BoxedJsPyFunctionWrapper, JsPyFunctionWrapper};

packages/cubejs-backend-native/src/python/runtime.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use neon::types::Deferred;
88
use once_cell::sync::OnceCell;
99
use pyo3::prelude::*;
1010
use pyo3::types::{PyFunction, PyTuple};
11-
use pyo3::AsPyPointer;
1211
use std::fmt::Formatter;
1312
use std::future::Future;
1413
use std::pin::Pin;

packages/cubejs-backend-native/src/python/utils.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use crate::cross::*;
22
use pyo3::exceptions::PyNotImplementedError;
33
use pyo3::prelude::*;
44
use pyo3::types::{PyFunction, PyString, PyTuple};
5-
use pyo3::AsPyPointer;
65

76
pub fn python_fn_call_sync(py_fun: &Py<PyFunction>, arguments: Vec<CLRepr>) -> PyResult<CLRepr> {
87
Python::with_gil(|py| {

0 commit comments

Comments
 (0)