public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-pendulum] f44: Remove old unused patches from git
@ 2026-06-30 21:11 Benjamin A. Beasley
  0 siblings, 0 replies; only message in thread
From: Benjamin A. Beasley @ 2026-06-30 21:11 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/python-pendulum
Branch : f44
Commit : dc1fb41165c79a24b3a5e9e264323644e088b762
Author : Benjamin A. Beasley <code@musicinmybrain.net>
Date   : 2026-06-30T20:57:03+01:00
Stats  : +0/-233 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/python-pendulum/c/dc1fb41165c79a24b3a5e9e264323644e088b762?branch=f44

Log:
Remove old unused patches from git

---
diff --git a/0001-Use-zoneinfo-instead-of-tzdata-package-to-retrieve-t.patch b/0001-Use-zoneinfo-instead-of-tzdata-package-to-retrieve-t.patch
deleted file mode 100644
index af6700d..0000000
--- a/0001-Use-zoneinfo-instead-of-tzdata-package-to-retrieve-t.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From d73091bbd8ae3e419734ddb2667431aae03f46de Mon Sep 17 00:00:00 2001
-From: Maxwell G <maxwell@gtmx.me>
-Date: Mon, 5 Feb 2024 18:04:15 +0000
-Subject: [PATCH 1/2] Use zoneinfo instead of tzdata package to retrieve
- timezones
-
-We want to use system timezone data, so we patch out the tzdata
-dependency.
----
- src/pendulum/tz/__init__.py | 7 ++-----
- 1 file changed, 2 insertions(+), 5 deletions(-)
-
-diff --git a/src/pendulum/tz/__init__.py b/src/pendulum/tz/__init__.py
-index 36c2c69..65a2e01 100644
---- a/src/pendulum/tz/__init__.py
-+++ b/src/pendulum/tz/__init__.py
-@@ -1,7 +1,6 @@
- from __future__ import annotations
- 
--from pathlib import Path
--from typing import cast
-+from zoneinfo import available_timezones
- 
- from pendulum.tz.local_timezone import get_local_timezone
- from pendulum.tz.local_timezone import set_local_timezone
-@@ -9,7 +8,6 @@ from pendulum.tz.local_timezone import test_local_timezone
- from pendulum.tz.timezone import UTC
- from pendulum.tz.timezone import FixedTimezone
- from pendulum.tz.timezone import Timezone
--from pendulum.utils._compat import resources
- 
- 
- PRE_TRANSITION = "pre"
-@@ -25,8 +23,7 @@ def timezones() -> tuple[str, ...]:
-     global _timezones
- 
-     if _timezones is None:
--        with cast(Path, resources.files("tzdata").joinpath("zones")).open() as f:
--            _timezones = tuple(tz.strip() for tz in f.readlines())
-+        _timezones = tuple(available_timezones())
- 
-     return _timezones
- 
--- 
-2.48.1
-

diff --git a/0002-Backport-support-for-PyO3-0.22-and-Python-3.13.patch b/0002-Backport-support-for-PyO3-0.22-and-Python-3.13.patch
deleted file mode 100644
index dfd8f37..0000000
--- a/0002-Backport-support-for-PyO3-0.22-and-Python-3.13.patch
+++ /dev/null
@@ -1,187 +0,0 @@
-From e7f8204b2022ca60adc62284be156791d0f48893 Mon Sep 17 00:00:00 2001
-From: Fabio Valentini <decathorpe@gmail.com>
-Date: Tue, 21 Jan 2025 13:07:53 +0100
-Subject: [PATCH 2/2] Backport support for PyO3 0.22 and Python 3.13
-
----
- rust/Cargo.toml            |  2 +-
- rust/src/python/helpers.rs | 91 ++++++++++++++++----------------------
- 2 files changed, 40 insertions(+), 53 deletions(-)
-
-diff --git a/rust/Cargo.toml b/rust/Cargo.toml
-index 0d76a89..778bc7c 100644
---- a/rust/Cargo.toml
-+++ b/rust/Cargo.toml
-@@ -14,7 +14,7 @@ strip = true
- overflow-checks = false
- 
- [dependencies]
--pyo3 = { version = "0.19.0", features = ["extension-module", "generate-import-lib"] }
-+pyo3 = { version = "0.22", features = ["extension-module", "generate-import-lib", "gil-refs"] }
- mimalloc = { version = "0.1.39", optional = true, default-features = false }
- 
- [features]
-diff --git a/rust/src/python/helpers.rs b/rust/src/python/helpers.rs
-index 4a53e59..047dbff 100644
---- a/rust/src/python/helpers.rs
-+++ b/rust/src/python/helpers.rs
-@@ -1,7 +1,6 @@
- use std::cmp::Ordering;
- 
- use pyo3::{
--    intern,
-     prelude::*,
-     types::{PyDate, PyDateAccess, PyDateTime, PyDelta, PyDeltaAccess, PyString, PyTimeAccess},
-     PyTypeInfo,
-@@ -74,57 +73,39 @@ impl PartialOrd for DateTimeInfo<'_> {
-     }
- }
- 
--pub fn get_tz_name<'py>(py: Python, dt: &'py PyAny) -> PyResult<&'py str> {
--    let tz: &str = "";
-+pub fn get_tz_name<'py>(dt: &Bound<'py, PyAny>) -> PyResult<String> {
-+    if !PyDateTime::is_type_of_bound(dt) {
-+        return Ok(String::new());
-+    }
-+
-+    let tzinfo: Bound<'py, PyAny> = dt.getattr("tzinfo")?;
- 
--    if !PyDateTime::is_type_of(dt) {
--        return Ok(tz);
-+    if tzinfo.is_none() {
-+        return Ok(String::new());
-     }
- 
--    let tzinfo = dt.getattr("tzinfo");
-+    let tzname_attr: Option<Bound<'py, PyAny>>;
- 
--    match tzinfo {
--        Err(_) => Ok(tz),
--        Ok(tzinfo) => {
--            if tzinfo.is_none() {
--                return Ok(tz);
--            }
--            if tzinfo.hasattr(intern!(py, "key")).unwrap_or(false) {
--                // zoneinfo timezone
--                let tzname: &PyString = tzinfo
--                    .getattr(intern!(py, "key"))
--                    .unwrap()
--                    .downcast()
--                    .unwrap();
--
--                return tzname.to_str();
--            } else if tzinfo.hasattr(intern!(py, "name")).unwrap_or(false) {
--                // Pendulum timezone
--                let tzname: &PyString = tzinfo
--                    .getattr(intern!(py, "name"))
--                    .unwrap()
--                    .downcast()
--                    .unwrap();
--
--                return tzname.to_str();
--            } else if tzinfo.hasattr(intern!(py, "zone")).unwrap_or(false) {
--                // pytz timezone
--                let tzname: &PyString = tzinfo
--                    .getattr(intern!(py, "zone"))
--                    .unwrap()
--                    .downcast()
--                    .unwrap();
--
--                return tzname.to_str();
--            }
-+    if tzinfo.hasattr("key")? {
-+        tzname_attr = Some(tzinfo.getattr("key")?);
-+    } else if tzinfo.hasattr("name")? {
-+        tzname_attr = Some(tzinfo.getattr("name")?);
-+    } else if tzinfo.hasattr("zone")? {
-+        tzname_attr = Some(tzinfo.getattr("zone")?);
-+    } else {
-+        tzname_attr = None;
-+    }
- 
--            Ok(tz)
--        }
-+    if let Some(tzname_attr) = tzname_attr {
-+        let tzname: &Bound<PyString> = tzname_attr.downcast()?;
-+        tzname.extract()
-+    } else {
-+        Ok(String::new())
-     }
- }
- 
--pub fn get_offset(dt: &PyAny) -> PyResult<i32> {
--    if !PyDateTime::is_type_of(dt) {
-+pub fn get_offset(dt: &Bound<PyAny>) -> PyResult<i32> {
-+    if !PyDateTime::is_type_of_bound(dt) {
-         return Ok(0);
-     }
- 
-@@ -134,7 +115,8 @@ pub fn get_offset(dt: &PyAny) -> PyResult<i32> {
-         return Ok(0);
-     }
- 
--    let offset: &PyDelta = tzinfo.call_method1("utcoffset", (dt,))?.downcast()?;
-+    let binding = tzinfo.call_method1("utcoffset", (dt,))?;
-+    let offset: &Bound<PyDelta> = binding.downcast()?;
- 
-     Ok(offset.get_days() * SECS_PER_DAY as i32 + offset.get_seconds())
- }
-@@ -169,8 +151,13 @@ pub fn local_time(
- }
- 
- #[pyfunction]
--pub fn precise_diff<'py>(py: Python, dt1: &'py PyAny, dt2: &'py PyAny) -> PyResult<PreciseDiff> {
-+pub fn precise_diff<'py>(
-+    dt1: &Bound<'py, PyAny>,
-+    dt2: &Bound<'py, PyAny>,
-+) -> PyResult<PreciseDiff> {
-     let mut sign = 1;
-+    let dt1_tz = get_tz_name(dt1)?;
-+    let dt2_tz = get_tz_name(dt2)?;
-     let mut dtinfo1 = DateTimeInfo {
-         year: dt1.downcast::<PyDate>()?.get_year(),
-         month: i32::from(dt1.downcast::<PyDate>()?.get_month()),
-@@ -180,9 +167,9 @@ pub fn precise_diff<'py>(py: Python, dt1: &'py PyAny, dt2: &'py PyAny) -> PyResu
-         second: 0,
-         microsecond: 0,
-         total_seconds: 0,
--        tz: get_tz_name(py, dt1)?,
-+        tz: dt1_tz.as_str(),
-         offset: get_offset(dt1)?,
--        is_datetime: PyDateTime::is_type_of(dt1),
-+        is_datetime: PyDateTime::is_type_of_bound(dt1),
-     };
-     let mut dtinfo2 = DateTimeInfo {
-         year: dt2.downcast::<PyDate>()?.get_year(),
-@@ -193,16 +180,16 @@ pub fn precise_diff<'py>(py: Python, dt1: &'py PyAny, dt2: &'py PyAny) -> PyResu
-         second: 0,
-         microsecond: 0,
-         total_seconds: 0,
--        tz: get_tz_name(py, dt2)?,
-+        tz: dt2_tz.as_str(),
-         offset: get_offset(dt2)?,
--        is_datetime: PyDateTime::is_type_of(dt2),
-+        is_datetime: PyDateTime::is_type_of_bound(dt2),
-     };
-     let in_same_tz: bool = dtinfo1.tz == dtinfo2.tz && !dtinfo1.tz.is_empty();
-     let mut total_days = helpers::day_number(dtinfo2.year, dtinfo2.month as u8, dtinfo2.day as u8)
-         - helpers::day_number(dtinfo1.year, dtinfo1.month as u8, dtinfo1.day as u8);
- 
-     if dtinfo1.is_datetime {
--        let dt1dt: &PyDateTime = dt1.downcast()?;
-+        let dt1dt: &Bound<PyDateTime> = dt1.downcast()?;
- 
-         dtinfo1.hour = i32::from(dt1dt.get_hour());
-         dtinfo1.minute = i32::from(dt1dt.get_minute());
-@@ -247,7 +234,7 @@ pub fn precise_diff<'py>(py: Python, dt1: &'py PyAny, dt2: &'py PyAny) -> PyResu
-     }
- 
-     if dtinfo2.is_datetime {
--        let dt2dt: &PyDateTime = dt2.downcast()?;
-+        let dt2dt: &Bound<PyDateTime> = dt2.downcast()?;
- 
-         dtinfo2.hour = i32::from(dt2dt.get_hour());
-         dtinfo2.minute = i32::from(dt2dt.get_minute());
--- 
-2.48.1
-

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-30 21:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-30 21:11 [rpms/python-pendulum] f44: Remove old unused patches from git Benjamin A. Beasley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox