Chrono: allow deprecation warning until upgrading to 0.4.35+ (#3935)

* Chrono: allow deprecation warning until upgrading to 0.4.35+

Requiring 0.4.35 is blocked on MSRV (Chrono: 1.61, PyO3: 1.56)

* also allow deprecated chrono in example

---------

Co-authored-by: David Hewitt <mail@davidhewitt.dev>
This commit is contained in:
Thomas Tanon 2024-03-06 18:49:43 +01:00 committed by GitHub
parent 57bbc32e7c
commit d35f41e0bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -19,6 +19,9 @@
//! # Example: Convert a `datetime.datetime` to chrono's `DateTime<Utc>`
//!
//! ```rust
//! # // `chrono::Duration` has been renamed to `chrono::TimeDelta` and its constructors changed
//! # // TODO: upgrade to Chrono 0.4.35+ after upgrading our MSRV to 1.61+
//! # #![allow(deprecated)]
//! use chrono::{DateTime, Duration, TimeZone, Utc};
//! use pyo3::{Python, ToPyObject};
//!
@ -39,6 +42,11 @@
//! });
//! }
//! ```
// `chrono::Duration` has been renamed to `chrono::TimeDelta` and its constructors changed
// TODO: upgrade to Chrono 0.4.35+ after upgrading our MSRV to 1.61+
#![allow(deprecated)]
use crate::exceptions::{PyTypeError, PyUserWarning, PyValueError};
#[cfg(Py_LIMITED_API)]
use crate::sync::GILOnceCell;