From 6b1afa4040cb8b2da71762633c74f42cf5cfbe17 Mon Sep 17 00:00:00 2001 From: David Hewitt <1939362+davidhewitt@users.noreply.github.com> Date: Sun, 24 Oct 2021 21:34:57 +0100 Subject: [PATCH] pypy: support 3.8 --- .github/workflows/ci.yml | 4 +++- CHANGELOG.md | 1 + src/ffi/datetime.rs | 12 ++++++------ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05d93832222..7b14961556b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,7 @@ jobs: fail-fast: false # If one platform fails, allow the rest to keep testing. matrix: rust: [stable] - python-version: [3.6, 3.7, 3.8, 3.9, "3.10", pypy-3.6, pypy-3.7] + python-version: [3.6, 3.7, 3.8, 3.9, "3.10", pypy-3.6, pypy-3.7, pypy-3.8] platform: [ { @@ -110,6 +110,8 @@ jobs: # PyPy 3.7 on Windows doesn't release 32-bit builds any more - python-version: pypy-3.7 platform: { os: "windows-latest", python-architecture: "x86" } + - python-version: pypy-3.8 + platform: { os: "windows-latest", python-architecture: "x86" } include: # PyPy3.6 still runs on macos-10.15 - rust: stable diff --git a/CHANGELOG.md b/CHANGELOG.md index e32c23adf41..a78ee55b99d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Support Python 3.10. [#1889](https://github.com/PyO3/pyo3/pull/1889) - Added optional `eyre` feature to convert `eyre::Report` into `PyErr`. [#1893](https://github.com/PyO3/pyo3/pull/1893) - Added optional `anyhow` feature to convert `anyhow::Error` into `PyErr`. [#1822](https://github.com/PyO3/pyo3/pull/1822) +- Support PyPy 3.8. [#1948](https://github.com/PyO3/pyo3/pull/1948) ### Added diff --git a/src/ffi/datetime.rs b/src/ffi/datetime.rs index 749286d82d2..8510b96edc4 100644 --- a/src/ffi/datetime.rs +++ b/src/ffi/datetime.rs @@ -361,7 +361,7 @@ pub struct PyDateTime_CAPI { pub TimeType: *mut PyTypeObject, pub DeltaType: *mut PyTypeObject, pub TZInfoType: *mut PyTypeObject, - #[cfg(all(Py_3_7, not(PyPy)))] + #[cfg(all(Py_3_7, any(not(PyPy), Py_3_8)))] pub TimeZone_UTC: *mut PyObject, pub Date_FromDate: unsafe extern "C" fn( year: c_int, @@ -395,7 +395,7 @@ pub struct PyDateTime_CAPI { normalize: c_int, cls: *mut PyTypeObject, ) -> *mut PyObject, - #[cfg(all(Py_3_7, not(PyPy)))] + #[cfg(all(Py_3_7, any(not(PyPy), Py_3_8)))] pub TimeZone_FromTimeZone: unsafe extern "C" fn(offset: *mut PyObject, name: *mut PyObject) -> *mut PyObject, @@ -451,7 +451,7 @@ pub static PyDateTimeAPI: _PyDateTimeAPI_impl = _PyDateTimeAPI_impl { /// /// The type obtained by dereferencing this object is `&'static PyObject`. This may change in the /// future to be a more specific type representing that this is a `datetime.timezone` object. -#[cfg(all(Py_3_7, not(PyPy)))] +#[cfg(all(Py_3_7, any(not(PyPy), Py_3_8)))] pub static PyDateTime_TimeZone_UTC: _PyDateTime_TimeZone_UTC_impl = _PyDateTime_TimeZone_UTC_impl { inner: &PyDateTimeAPI, }; @@ -609,12 +609,12 @@ impl Deref for _PyDateTimeAPI_impl { } #[doc(hidden)] -#[cfg(all(Py_3_7, not(PyPy)))] +#[cfg(all(Py_3_7, any(not(PyPy), Py_3_8)))] pub struct _PyDateTime_TimeZone_UTC_impl { inner: &'static _PyDateTimeAPI_impl, } -#[cfg(all(Py_3_7, not(PyPy)))] +#[cfg(all(Py_3_7, any(not(PyPy), Py_3_8)))] impl Deref for _PyDateTime_TimeZone_UTC_impl { type Target = crate::PyObject; @@ -661,7 +661,7 @@ mod tests { } #[test] - #[cfg(all(Py_3_7, not(PyPy)))] + #[cfg(all(Py_3_7, any(not(PyPy), Py_3_8)))] fn test_utc_timezone() { Python::with_gil(|py| { let utc_timezone = PyDateTime_TimeZone_UTC.as_ref(py);