Skip to content

Commit

Permalink
ci: add pypy 3.9 dev
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Feb 5, 2022
1 parent 199cc98 commit 6ae2fc3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Expand Up @@ -76,7 +76,16 @@ jobs:
fail-fast: false # If one platform fails, allow the rest to keep testing.
matrix:
rust: [stable]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev", "pypy-3.7", "pypy-3.8"]
python-version: [
"3.7",
"3.8",
"3.9",
"3.10",
"3.11-dev",
"pypy-3.7",
"pypy-3.8",
"pypy-3.9-dev"
]
platform:
[
{
Expand Down
28 changes: 23 additions & 5 deletions pyo3-ffi/src/cpython/abstract_.rs
Expand Up @@ -6,7 +6,7 @@ use crate::{
pyport::PY_SSIZE_T_MAX, vectorcallfunc, PyCallable_Check, PyThreadState, PyThreadState_GET,
PyTuple_Check, PyType_HasFeature, Py_TPFLAGS_HAVE_VECTORCALL,
};
#[cfg(all(Py_3_8, not(PyPy)))]
#[cfg(Py_3_8)]
use libc::size_t;

extern "C" {
Expand Down Expand Up @@ -98,17 +98,29 @@ pub unsafe fn PyObject_Vectorcall(
}

extern "C" {
#[cfg(all(Py_3_8, not(PyPy)))]
#[cfg_attr(not(Py_3_9), link_name = "_PyObject_VectorcallDict")]
#[cfg(all(PyPy, Py_3_8))]
#[cfg_attr(not(Py_3_9), link_name = "_PyPyObject_Vectorcall")]
pub fn PyObject_Vectorcall(
callable: *mut PyObject,
args: *const *mut PyObject,
nargsf: size_t,
kwnames: *mut PyObject,
) -> *mut PyObject;

#[cfg(all(Py_3_8))]
#[cfg_attr(all(not(PyPy), not(Py_3_9)), link_name = "_PyObject_VectorcallDict")]
#[cfg_attr(all(PyPy, not(Py_3_9)), link_name = "_PyPyObject_VectorcallDict")]
#[cfg_attr(all(PyPy, Py_3_9), link_name = "PyPyObject_VectorcallDict")]
pub fn PyObject_VectorcallDict(
callable: *mut PyObject,
args: *const *mut PyObject,
nargsf: size_t,
kwargs: *mut PyObject,
kwdict: *mut PyObject,
) -> *mut PyObject;

#[cfg(all(Py_3_8, not(PyPy)))]
#[cfg(all(Py_3_8))]
#[cfg_attr(not(Py_3_9), link_name = "_PyVectorcall_Call")]
#[cfg_attr(PyPy, link_name = "PyPyVectorcall_Call")]
pub fn PyVectorcall_Call(
callable: *mut PyObject,
tuple: *mut PyObject,
Expand Down Expand Up @@ -149,6 +161,12 @@ pub unsafe fn _PyObject_CallNoArg(func: *mut PyObject) -> *mut PyObject {
)
}

extern "C" {
#[cfg(PyPy)]
#[link_name = "_PyPyObject_CallNoArg"]
pub fn _PyObject_CallNoArg(func: *mut PyObject) -> *mut PyObject;
}

#[cfg(all(Py_3_8, not(PyPy)))]
#[inline(always)]
pub unsafe fn PyObject_CallOneArg(func: *mut PyObject, arg: *mut PyObject) -> *mut PyObject {
Expand Down

0 comments on commit 6ae2fc3

Please sign in to comment.