Skip to content

Commit

Permalink
pypy: support 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Oct 27, 2021
1 parent 13fc4f1 commit 6b1afa4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Expand Up @@ -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:
[
{
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -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

Expand Down
12 changes: 6 additions & 6 deletions src/ffi/datetime.rs
Expand Up @@ -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,
Expand Down Expand Up @@ -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,

Expand Down Expand Up @@ -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,
};
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 6b1afa4

Please sign in to comment.