Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-convertdate for 
openSUSE:Factory checked in at 2026-11-27 21:03:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-convertdate (Old)
 and      /work/SRC/openSUSE:Factory/.python-convertdate.new.1340718 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-convertdate"

Fri Nov 27 21:03:16 2026 rev:13 rq:1400847 version:2.5.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-convertdate/python-convertdate.changes    
2026-03-31 15:46:35.449179510 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-convertdate.new.1340718/python-convertdate.changes
       2026-11-27 21:03:39.221158382 +0100
@@ -1,0 +2,9 @@
+Mon Nov  9 15:52:17 UTC 2026 - Danilo Spinella <[email protected]>
+
+- Update to 2.5.1:
+  * Bug fix for Bahai calendar
+- Update to 2.5.0:
+  * Bug fix for Coptic calendar
+  * Bug fix for ordinal calendar
+
+-------------------------------------------------------------------

Old:
----
  v2.4.1.tar.gz

New:
----
  v2.5.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-convertdate.spec ++++++
--- /var/tmp/diff_new_pack.RwZ2ia/_old  2026-11-27 21:03:40.033192499 +0100
+++ /var/tmp/diff_new_pack.RwZ2ia/_new  2026-11-27 21:03:40.035192583 +0100
@@ -18,7 +18,7 @@
 
 %{?sle15_python_module_pythons}
 Name:           python-convertdate
-Version:        2.4.1
+Version:        2.5.1
 Release:        0
 Summary:        Module for date conversions from and to Gregorian calendar
 License:        MIT
@@ -28,10 +28,10 @@
 BuildRequires:  %{python_module wheel}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
-Requires:       python-PyMeeus >= 0.3.6
+Requires:       python-PyMeeus >= 0.3.13
 BuildArch:      noarch
 # SECTION test requirements
-BuildRequires:  %{python_module PyMeeus >= 0.3.6}
+BuildRequires:  %{python_module PyMeeus >= 0.3.13}
 BuildRequires:  %{python_module pytest-xdist}
 BuildRequires:  %{python_module pytest}
 # /SECTION

++++++ v2.4.1.tar.gz -> v2.5.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/convertdate-2.4.1/.github/workflows/python.yml 
new/convertdate-2.5.1/.github/workflows/python.yml
--- old/convertdate-2.4.1/.github/workflows/python.yml  2026-02-08 
01:32:41.000000000 +0100
+++ new/convertdate-2.5.1/.github/workflows/python.yml  2026-09-13 
23:19:19.000000000 +0200
@@ -16,8 +16,6 @@
     strategy:
       matrix:
         python-version:
-          - '3.8'
-          - '3.9'
           - '3.10'
           - '3.11'
           - '3.12'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/convertdate-2.4.1/HISTORY.rst 
new/convertdate-2.5.1/HISTORY.rst
--- old/convertdate-2.4.1/HISTORY.rst   2026-02-08 01:32:41.000000000 +0100
+++ new/convertdate-2.5.1/HISTORY.rst   2026-09-13 23:19:19.000000000 +0200
@@ -1,6 +1,19 @@
 History
 =======
 
+2.5.1
+-----
+* Bug fix for Bahai calendar (#67)
+
+2.5.0
+-----
+* Bug fix for Coptic calendar (#65)
+* Bug fix for ordinal calendar (#66)
+
+2.4.1
+-----
+* Bug fix for monthcalendar (#58)
+
 2.4.0
 -----
 * Drop official support for Python version 3.5 and 3.6, which have reached 
end-of-life.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/convertdate-2.4.1/pyproject.toml 
new/convertdate-2.5.1/pyproject.toml
--- old/convertdate-2.4.1/pyproject.toml        2026-02-08 01:32:41.000000000 
+0100
+++ new/convertdate-2.5.1/pyproject.toml        2026-09-13 23:19:19.000000000 
+0200
@@ -7,13 +7,14 @@
 name = "convertdate"
 description = "Converts between Gregorian dates and other calendar systems"
 authors = [
-    {name = "Neil Freeman", email = "[email protected]"}
+    {name = "Neil Freeman", email = "[email protected]"},
+    {name = "Phil Schwartz"}
     ]
 readme = "README.md"
-license = {file = "LICENSE"}
+license = "MIT"
+license-files = ["LICENSE"]
 keywords = ["calendar", "date", "time"]
 classifiers = [
-    "License :: OSI Approved :: MIT License",
     "Natural Language :: English",
     "Programming Language :: Python",
     "Programming Language :: Python :: 3.8",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/convertdate-2.4.1/src/convertdate/__init__.py 
new/convertdate-2.5.1/src/convertdate/__init__.py
--- old/convertdate-2.4.1/src/convertdate/__init__.py   2026-02-08 
01:32:41.000000000 +0100
+++ new/convertdate-2.5.1/src/convertdate/__init__.py   2026-09-13 
23:19:19.000000000 +0200
@@ -40,7 +40,7 @@
     utils,
 )
 
-__version__ = '2.4.1'
+__version__ = '2.5.1'
 
 __all__ = [
     'armenian',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/convertdate-2.4.1/src/convertdate/bahai.py 
new/convertdate-2.5.1/src/convertdate/bahai.py
--- old/convertdate-2.4.1/src/convertdate/bahai.py      2026-02-08 
01:32:41.000000000 +0100
+++ new/convertdate-2.5.1/src/convertdate/bahai.py      2026-09-13 
23:19:19.000000000 +0200
@@ -8,9 +8,9 @@
 """
 The Bahá'í (Badí) calendar is a solar calendar with 19 months of 19 days.
 
-Every four years, an intercalary period, Ayyam-i-Há, occurs between the 18th 
and 19th
-months. Dates in this period are returned as month 19, and the month of ‘Alá 
is always
-reported as month 20.
+An intercalary period, Ayyam-i-Há, occurs between the 18th and 19th months, has
+either four or five days. Dates in this period are returned as month 19, and
+the month of ‘Alá is always reported as month 20.
 
 .. code-block:: python
 
@@ -149,24 +149,14 @@
 def from_jd(jd):
     '''Calculate Bahai date from Julian day'''
     jd = trunc(jd) + 0.5
-    g = gregorian.from_jd(jd)
-    gy = g[0]
+    gy = gregorian.from_jd(jd)[0]
     n_month, n_day = gregorian_nawruz(gy)
 
-    bstarty = EPOCH_GREGORIAN_YEAR
-
-    if jd <= gregorian.to_jd(gy, n_month, 20):
-        x = 1
-    else:
-        x = 0
-    # verify this next line...
-    bys = gy - (bstarty + (((gregorian.to_jd(gy, 1, 1) <= jd) and x)))
-
-    year = bys + 1
+    x = 1 if jd < gregorian.to_jd(gy, n_month, n_day) else 0
+    year = gy - (EPOCH_GREGORIAN_YEAR + x) + 1
     days = jd - to_jd(year, 1, 1)
-    bld = to_jd(year, n_day - 1, 1)
 
-    if jd >= bld:
+    if jd >= to_jd(year, 20, 1):
         month = 20
     else:
         month = trunc(days / 19) + 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/convertdate-2.4.1/src/convertdate/coptic.py 
new/convertdate-2.5.1/src/convertdate/coptic.py
--- old/convertdate-2.4.1/src/convertdate/coptic.py     2026-02-08 
01:32:41.000000000 +0100
+++ new/convertdate-2.5.1/src/convertdate/coptic.py     2026-09-13 
23:19:19.000000000 +0200
@@ -13,6 +13,7 @@
 It consists of twelve months of 30 days, followed by a "little month" of five 
days
 (six in leap years).
 """
+
 from math import floor
 
 from . import gregorian
@@ -49,8 +50,7 @@
 
 def from_jd(jdc):
     "Create a new date from a Julian date."
-    cdc = floor(jdc) + 0.5 - EPOCH
-    year = floor((cdc - floor((cdc + 366) / 1461)) / 365) + 1
+    year = floor((4 * floor(jdc - EPOCH) + 1463) / 1461)
 
     yday = jdc - to_jd(year, 1, 1)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/convertdate-2.4.1/src/convertdate/ordinal.py 
new/convertdate-2.5.1/src/convertdate/ordinal.py
--- old/convertdate-2.4.1/src/convertdate/ordinal.py    2026-02-08 
01:32:41.000000000 +0100
+++ new/convertdate-2.5.1/src/convertdate/ordinal.py    2026-09-13 
23:19:19.000000000 +0200
@@ -22,9 +22,16 @@
 
 
 def from_jd(jd):
-    '''Convert a Julian day count to an ordinal date.'''
-    year, _, _ = gregorian.from_jd(jd)
-    return year, round(jd - gregorian.to_jd(year, 1, 1) + 1)
+    '''Convert a Julian day count to an ordinal date.
+
+    The day of year is derived from the Gregorian date rather than the raw
+    ``jd``. Both ``to_jd`` values carry the same half-day offset, so their
+    difference is an exact whole number of days; subtracting ``jd`` directly
+    leaves a ``.5`` remainder that ``round`` pushes the wrong way (e.g.
+    ``365.5`` -> ``366``), reporting a non-existent day 366 in common years.
+    '''
+    year, month, day = gregorian.from_jd(jd)
+    return year, int(gregorian.to_jd(year, month, day) - gregorian.to_jd(year, 
1, 1)) + 1
 
 
 def from_gregorian(year, month, day):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/convertdate-2.4.1/tests/test_bahai.py 
new/convertdate-2.5.1/tests/test_bahai.py
--- old/convertdate-2.4.1/tests/test_bahai.py   2026-02-08 01:32:41.000000000 
+0100
+++ new/convertdate-2.5.1/tests/test_bahai.py   2026-09-13 23:19:19.000000000 
+0200
@@ -1,5 +1,6 @@
 # -*- coding: utf-8 -*-
 """Test the Bahá’í calendar"""
+
 import time
 import unittest
 
@@ -9,8 +10,9 @@
 
 
 class TestBahai(CalTestCase):
-
     pairs = {
+        (2016, 2, 26): (172, bahai.AYYAMIHA, 1),
+        (2016, 3, 20): (173, bahai.BAHA, 1),
         (2041, 11, 27): (198, bahai.QAWL, 6),  # ascension of Abdu'l-Bahá 2041
         (2043, 11, 28): (200, bahai.QAWL, 6),  # ascension of Abdu'l-Bahá 2043
         (2038, 3, 1): (194, bahai.ALA, 1),  # beginning of fast 2038
@@ -149,6 +151,17 @@
         for g, b in self.pairs.items():
             self.assertEqual(b, bahai.from_gregorian(*g))
 
+    def test_near_ayyam_i_ha(self):
+        pairs = [
+            ((2016, 2, 25), (172, 18, 19)),
+            ((2016, 2, 26), (172, 19, 1)),
+            ((2016, 2, 29), (172, 19, 4)),
+            ((2016, 3, 1), (172, 20, 1))
+        ]
+        with self.subTest():
+            for gdate, bdate in pairs:
+                self.assertEqual(bdate, bahai.from_gregorian(*gdate))
+
     def test_month_length(self):
         for x in range(1, 19):
             self.assertEqual(bahai.month_length(2019, x), 19)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/convertdate-2.4.1/tests/test_coptic.py 
new/convertdate-2.5.1/tests/test_coptic.py
--- old/convertdate-2.4.1/tests/test_coptic.py  1970-01-01 01:00:00.000000000 
+0100
+++ new/convertdate-2.5.1/tests/test_coptic.py  2026-09-13 23:19:19.000000000 
+0200
@@ -0,0 +1,68 @@
+from convertdate import coptic
+
+from . import CalTestCase
+
+
+class TestGregorian(CalTestCase):
+    def setUp(self):
+        pass
+
+    def test_epoch(self):
+        self.assertEqual(coptic.to_jd(1, 1, 1), coptic.EPOCH)
+        self.assertEqual(coptic.to_jd(1, 1, 2), coptic.EPOCH + 1)
+        self.assertEqual(coptic.to_jd(2, 1, 1), coptic.EPOCH + 365.0)
+        self.assertEqual(coptic.from_jd(coptic.EPOCH), (1, 1, 1))
+
+    def test_is_leap(self):
+        self.assertTrue(coptic.is_leap(1839))
+        self.assertTrue(coptic.is_leap(1891))
+        self.assertTrue(coptic.is_leap(1999))
+        self.assertTrue(coptic.is_leap(2423))
+
+        self.assertFalse(coptic.is_leap(1800))
+        self.assertFalse(coptic.is_leap(1890))
+        self.assertFalse(coptic.is_leap(1956))
+        self.assertFalse(coptic.is_leap(2000))
+
+    def test_reflexive_jd(self):
+        self.assertEqual(coptic.from_jd(2431772.0), (1662, 3, 3))
+
+        # leap year 1891
+        self.assertEqual(coptic.from_jd(2515715.5), (1891, 13, 5))
+        self.assertEqual(coptic.to_jd(1891, 13, 5), 2515715.5)
+        self.assertEqual(coptic.from_jd(2515716.0), (1891, 13, 5))
+
+        self.assertEqual(coptic.from_jd(2515716.5), (1891, 13, 6))
+        self.assertEqual(coptic.to_jd(1891, 13, 6), 2515716.5)
+        self.assertEqual(coptic.from_jd(2515717.0), (1891, 13, 6))
+
+        self.assertEqual(coptic.from_jd(2515717.5), (1892, 1, 1))
+        self.assertEqual(coptic.to_jd(1892, 1, 1), 2515717.5)
+        self.assertEqual(coptic.from_jd(2515718.0), (1892, 1, 1))
+
+        # regular year 2000 (%4=0)
+        self.assertEqual(coptic.from_jd(2555528.0), (2000, 13, 4))
+        self.assertEqual(coptic.from_jd(2555528.5), (2000, 13, 5))
+        self.assertEqual(coptic.to_jd(2000, 13, 5), 2555528.5)
+        self.assertEqual(coptic.from_jd(2555529.0), (2000, 13, 5))
+        self.assertEqual(coptic.from_jd(2555529.5), (2001, 1, 1))
+
+        # regular year 1889 (%4=1)
+        self.assertEqual(coptic.from_jd(2514984.5), (1889, 13, 4))
+        self.assertEqual(coptic.to_jd(1889, 13, 4), 2514984.5)
+        self.assertEqual(coptic.from_jd(2514985.0), (1889, 13, 4))
+
+        self.assertEqual(coptic.from_jd(2514985.5), (1889, 13, 5))
+        self.assertEqual(coptic.to_jd(1889, 13, 5), 2514985.5)
+        self.assertEqual(coptic.from_jd(2514986.0), (1889, 13, 5))
+
+        # regular year 1886 (%4=2)
+        self.assertEqual(coptic.from_jd(2513888.5), (1886, 13, 4))
+        self.assertEqual(coptic.to_jd(1886, 13, 4), 2513888.5)
+        self.assertEqual(coptic.from_jd(2513889.0), (1886, 13, 4))
+        self.assertEqual(coptic.from_jd(2513889.5), (1886, 13, 5))
+        self.assertEqual(coptic.to_jd(1886, 13, 5), 2513889.5)
+        self.assertEqual(coptic.from_jd(2513890.0), (1886, 13, 5))
+        self.assertEqual(coptic.from_jd(2513890.5), (1887, 1, 1))
+        self.assertEqual(coptic.to_jd(1887, 1, 1), 2513890.5)
+        self.assertEqual(coptic.from_jd(2513891.0), (1887, 1, 1))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/convertdate-2.4.1/tests/test_ordinal.py 
new/convertdate-2.5.1/tests/test_ordinal.py
--- old/convertdate-2.4.1/tests/test_ordinal.py 2026-02-08 01:32:41.000000000 
+0100
+++ new/convertdate-2.5.1/tests/test_ordinal.py 2026-09-13 23:19:19.000000000 
+0200
@@ -1,6 +1,6 @@
 from calendar import isleap
 
-from convertdate import ordinal
+from convertdate import gregorian, ordinal
 
 from . import CalTestCase
 
@@ -57,3 +57,32 @@
                 self.assertEqual(ordinal.from_gregorian(year, 2, 29), (year, 
60))
 
             self.assertEqual(ordinal.from_gregorian(year, 3, 1), (year, 60 + 
leap))
+
+    def test_from_jd_dec_31_common_year(self):
+        # An integer Julian day count for December 31 of a common year must map
+        # to ordinal day 365, not the non-existent day 366. Regression for the
+        # ``round(365.5) -> 366`` half-day rounding bug in ``from_jd``.
+        for year in (2021, 2022, 2023, 2025, 2100, 2200):
+            self.assertFalse(isleap(year))
+            jd = gregorian.to_jd(year, 12, 31)  # ...5 (midnight) form
+            self.assertEqual(ordinal.from_jd(jd), (year, 365))
+            # and the integer JDN that gregorian maps to that same day
+            self.assertEqual(ordinal.from_jd(int(jd) + 1), (year, 365))
+
+    def test_from_jd_dec_31_leap_year(self):
+        # Leap-year December 31 stays day 366.
+        for year in (2020, 2024, 2000):
+            self.assertTrue(isleap(year))
+            self.assertEqual(ordinal.from_jd(gregorian.to_jd(year, 12, 31)), 
(year, 366))
+            self.assertEqual(ordinal.from_jd(int(gregorian.to_jd(year, 12, 
31)) + 1), (year, 366))
+
+    def test_from_jd_consistent_with_gregorian(self):
+        # For any Julian day -- integer count or ``.5`` midnight form -- the
+        # ordinal date must describe the same calendar day as 
gregorian.from_jd,
+        # and never yield a day of year beyond the length of its year.
+        for jd in range(2415020, 2488395, 7):
+            for j in (jd, jd + 0.5):
+                year, doy = ordinal.from_jd(j)
+                self.assertEqual((year, doy), 
ordinal.from_gregorian(*gregorian.from_jd(j)))
+                self.assertLessEqual(doy, 366 if isleap(year) else 365)
+                self.assertGreaterEqual(doy, 1)

Reply via email to