Package: release.debian.org
Severity: normal
Tags: bullseye
User: release.debian....@packages.debian.org
Usertags: pu
X-Debbugs-Cc: distro-info-d...@packages.debian.org
Control: affects -1 + src:distro-info-data

Bullseye version of #1055009.

[ Reason ]
This is a regular distro-info-data update, adding Ubuntu 24.04 LTS.
It includes some corrections to historical data, one of which affects
the distro-info test-suite.

So, included is a coupled update of distro-info to expect the new values
in its test-suite. In unstable, I updated Build-Depends and Depends on
distro-info-data to help autopkgtests. For stable I just updated the
Build-Depends.

In addition to the changes backported in bullseye is a set of patches to
ensure distro-info's Python packaging metadata version PEP-440
compliant.

[ Impact ]
Stable systems would be unaware of the new Ubuntu LTS.

[ Tests ]
distro-info-data is just CSV data, with some automated tests to verify
the structure and sanity-check the values.

distro-info has a more complex test suite that covers real-world tests
with old stable releases. This needed to be updated for the data
changes.

Build tests and autopkgtests pass in both packages.

Manually verified that the Python package has valid PEP-440 metadata.

[ Risks ]
Trivial, low risk.

[ Checklist ]
  [x] *all* changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in (old)stable
  [x] the issue is verified as fixed in unstable

[ Changes ]

 distro-info-data (0.51+deb11u5) bullseye; urgency=medium
   * Update data to 0.59:
     - Add Ubuntu 24.04 LTS Noble Numbat (LP: #2041662).
     - Correct Ubuntu 6.10 EOL date to 2008-04-25
     - Correct Ubuntu 16.04 ESM begin to 2021-04-30
     - Move Ubuntu 12.04 ESM end date back to Friday, 2019-04-26
     - Correct Debian 3.1 EOL date to 2008-03-31
     - Correct Debian 7 EOL date to 2016-04-25
     - Move Debian 9 EOL to the 9.13 release date 2020-07-18
     - Move Debian 10 EOL to the 10.13 release date 2022-09-10

 distro-info (1.0+deb11u1) bullseye; urgency=medium
   * python:
     - Assert that Python version is PEP440 compliant
     - Handle more Debian versions correctly in make_pep440_compliant
   * Update tests for distro-info-data 0.51+deb11u5, which adjusted Debian 7's
     EoL (Closes: #1054946)

diff --git a/debian.csv b/debian.csv
index 8272895..2646246 100644
--- a/debian.csv
+++ b/debian.csv
@@ -6,14 +6,14 @@ version,codename,series,created,release,eol,eol-lts,eol-elts
 2.1,Slink,slink,1998-07-24,1999-03-09,2000-10-30
 2.2,Potato,potato,1999-03-09,2000-08-15,2003-07-30
 3.0,Woody,woody,2000-08-15,2002-07-19,2006-06-30
-3.1,Sarge,sarge,2002-07-19,2005-06-06,2008-03-30
+3.1,Sarge,sarge,2002-07-19,2005-06-06,2008-03-31
 4.0,Etch,etch,2005-06-06,2007-04-08,2010-02-15
 5.0,Lenny,lenny,2007-04-08,2009-02-14,2012-02-06
 6.0,Squeeze,squeeze,2009-02-14,2011-02-06,2014-05-31,2016-02-29
-7,Wheezy,wheezy,2011-02-06,2013-05-04,2016-04-26,2018-05-31,2020-06-30
+7,Wheezy,wheezy,2011-02-06,2013-05-04,2016-04-25,2018-05-31,2020-06-30
 8,Jessie,jessie,2013-05-04,2015-04-26,2018-06-17,2020-06-30,2025-06-30
-9,Stretch,stretch,2015-04-26,2017-06-17,2020-07-06,2022-06-30,2027-06-30
-10,Buster,buster,2017-06-17,2019-07-06,2022-08-14,2024-06-30,2029-06-30
+9,Stretch,stretch,2015-04-26,2017-06-17,2020-07-18,2022-06-30,2027-06-30
+10,Buster,buster,2017-06-17,2019-07-06,2022-09-10,2024-06-30,2029-06-30
 11,Bullseye,bullseye,2019-07-06,2021-08-14,2024-08-14
 12,Bookworm,bookworm,2021-08-14,2023-06-10,2026-06-10
 13,Trixie,trixie,2023-06-10
diff --git a/debian/changelog b/debian/changelog
index ea4f4da..aee8df2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,17 @@
+distro-info-data (0.51+deb11u5) bullseye; urgency=medium
+
+  * Update data to 0.59:
+    - Add Ubuntu 24.04 LTS Noble Numbat (LP: #2041662).
+    - Correct Ubuntu 6.10 EOL date to 2008-04-25
+    - Correct Ubuntu 16.04 ESM begin to 2021-04-30
+    - Move Ubuntu 12.04 ESM end date back to Friday, 2019-04-26
+    - Correct Debian 3.1 EOL date to 2008-03-31
+    - Correct Debian 7 EOL date to 2016-04-25
+    - Move Debian 9 EOL to the 9.13 release date 2020-07-18
+    - Move Debian 10 EOL to the 10.13 release date 2022-09-10
+
+ -- Stefano Rivera <stefa...@debian.org>  Sun, 29 Oct 2023 14:57:15 +0200
+
 distro-info-data (0.51+deb11u4) bullseye; urgency=medium
 
   * Update data to 0.58:
diff --git a/ubuntu.csv b/ubuntu.csv
index 14ef832..3667f04 100644
--- a/ubuntu.csv
+++ b/ubuntu.csv
@@ -3,7 +3,7 @@ version,codename,series,created,release,eol,eol-server,eol-esm
 5.04,Hoary Hedgehog,hoary,2004-10-20,2005-04-08,2006-10-31
 5.10,Breezy Badger,breezy,2005-04-08,2005-10-12,2007-04-13
 6.06 LTS,Dapper Drake,dapper,2005-10-12,2006-06-01,2009-07-14,2011-06-01
-6.10,Edgy Eft,edgy,2006-06-01,2006-10-26,2008-04-26
+6.10,Edgy Eft,edgy,2006-06-01,2006-10-26,2008-04-25
 7.04,Feisty Fawn,feisty,2006-10-26,2007-04-19,2008-10-19
 7.10,Gutsy Gibbon,gutsy,2007-04-19,2007-10-18,2009-04-18
 8.04 LTS,Hardy Heron,hardy,2007-10-18,2008-04-24,2011-05-12,2013-05-09
@@ -14,7 +14,7 @@ version,codename,series,created,release,eol,eol-server,eol-esm
 10.10,Maverick Meerkat,maverick,2010-04-29,2010-10-10,2012-04-10
 11.04,Natty Narwhal,natty,2010-10-10,2011-04-28,2012-10-28
 11.10,Oneiric Ocelot,oneiric,2011-04-28,2011-10-13,2013-05-09
-12.04 LTS,Precise 
Pangolin,precise,2011-10-13,2012-04-26,2017-04-28,2017-04-28,2019-04-28
+12.04 LTS,Precise 
Pangolin,precise,2011-10-13,2012-04-26,2017-04-28,2017-04-28,2019-04-26
 12.10,Quantal Quetzal,quantal,2012-04-26,2012-10-18,2014-05-16
 13.04,Raring Ringtail,raring,2012-10-18,2013-04-25,2014-01-27
 13.10,Saucy Salamander,saucy,2013-04-25,2013-10-17,2014-07-17
@@ -22,7 +22,7 @@ version,codename,series,created,release,eol,eol-server,eol-esm
 14.10,Utopic Unicorn,utopic,2014-04-17,2014-10-23,2015-07-23
 15.04,Vivid Vervet,vivid,2014-10-23,2015-04-23,2016-02-04
 15.10,Wily Werewolf,wily,2015-04-23,2015-10-22,2016-07-28
-16.04 LTS,Xenial 
Xerus,xenial,2015-10-22,2016-04-21,2021-04-21,2021-04-21,2026-04-23
+16.04 LTS,Xenial 
Xerus,xenial,2015-10-22,2016-04-21,2021-04-30,2021-04-30,2026-04-23
 16.10,Yakkety Yak,yakkety,2016-04-21,2016-10-13,2017-07-20
 17.04,Zesty Zapus,zesty,2016-10-13,2017-04-13,2018-01-13
 17.10,Artful Aardvark,artful,2017-04-13,2017-10-19,2018-07-19
@@ -38,3 +38,4 @@ version,codename,series,created,release,eol,eol-server,eol-esm
 22.10,Kinetic Kudu,kinetic,2022-04-21,2022-10-20,2023-07-20
 23.04,Lunar Lobster,lunar,2022-10-20,2023-04-20,2024-01-25
 23.10,Mantic Minotaur,mantic,2023-04-20,2023-10-12,2024-07-11
+24.04 LTS,Noble 
Numbat,noble,2023-10-12,2024-04-25,2029-05-31,2029-05-31,2034-04-25
diff --git a/validate-csv-data b/validate-csv-data
index e4c1fea..c7f8ce5 100755
--- a/validate-csv-data
+++ b/validate-csv-data
@@ -150,7 +150,7 @@ def validate(filename, distro):
                     continue
                 if not eol_date:
                     continue
-                if eol_date >= date(2021, 1, 1):
+                if eol_date >= date(2021, 5, 1):
                     if eol_date.weekday() == 0 or eol_date.weekday() >= 4:
                         msg = (
                             f"{column} for {row['codename']}"
diff --git a/debian/changelog b/debian/changelog
index cbb1c1c..1a0a9fc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+distro-info (1.0+deb11u1) bullseye; urgency=medium
+
+  * python:
+    - Assert that Python version is PEP440 compliant
+    - Handle more Debian versions correctly in make_pep440_compliant
+  * Update tests for distro-info-data 0.51+deb11u5, which adjusted Debian 7's
+    EoL (Closes: #1054946)
+
+ -- Stefano Rivera <stefa...@debian.org>  Sun, 29 Oct 2023 14:48:16 +0200
+
 distro-info (1.0) unstable; urgency=medium
 
   [ Debian Janitor ]
diff --git a/debian/control b/debian/control
index bf316e4..47886d9 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,7 @@ Maintainer: Benjamin Drung <bdr...@debian.org>
 Uploaders: Stefano Rivera <stefa...@debian.org>
 Build-Depends: debhelper-compat (= 13),
                dh-python,
-               distro-info-data (>= 0.46),
+               distro-info-data (>= 0.51+deb11u5~),
                pylint (>= 2.2.2-2~),
                python3-all,
                python3-flake8,
diff --git a/python/distro_info_test/test_setup.py 
b/python/distro_info_test/test_setup.py
new file mode 100644
index 0000000..f20fa86
--- /dev/null
+++ b/python/distro_info_test/test_setup.py
@@ -0,0 +1,58 @@
+# Copyright (C) 2022, Benjamin Drung <bdr...@debian.org>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE.
+
+"""Test functions in setup.py."""
+
+import unittest
+import unittest.mock
+
+from setup import make_pep440_compliant
+
+
+class SetupTestCase(unittest.TestCase):
+    """Test functions in setup.py."""
+
+    def test_make_pep440_compliant_unchanged(self) -> None:
+        """Test make_pep440_compliant() with already correct version."""
+        self.assertEqual(make_pep440_compliant("1.2"), "1.2")
+
+    def test_make_pep440_compliant_debian_backport(self) -> None:
+        """Test make_pep440_compliant() with Debian backport version."""
+        self.assertEqual(make_pep440_compliant("0.21~bpo9+1"), "0.21+bpo9.1")
+
+    def test_make_pep440_compliant_debian_stable(self) -> None:
+        """Test make_pep440_compliant() with Debian stable update."""
+        self.assertEqual(make_pep440_compliant("2.21.3+deb11u1"), 
"2.21.3+deb11u1")
+
+    def test_make_pep440_compliant_debian_stable_backport(self) -> None:
+        """Test make_pep440_compliant() with Debian stable backport."""
+        self.assertEqual(make_pep440_compliant("2.21.3+deb11u1~bpo10+1"), 
"2.21.3+deb11u1.bpo10.1")
+
+    def test_make_pep440_compliant_tilde(self) -> None:
+        """Test make_pep440_compliant() with tilde in Debian version."""
+        self.assertEqual(make_pep440_compliant("0.175~18.04.3"), 
"0.175+18.04.3")
+
+    def test_make_pep440_compliant_ubuntu(self) -> None:
+        """Test make_pep440_compliant() with Ubuntu version."""
+        self.assertEqual(make_pep440_compliant("1.1ubuntu1"), "1.1+ubuntu1")
+
+    def test_make_pep440_compliant_ubuntu_backport(self) -> None:
+        """Test make_pep440_compliant() with Ubuntu backport version."""
+        self.assertEqual(
+            make_pep440_compliant("2.22.1ubuntu1~bpo20.04.1"), 
"2.22.1+ubuntu1.bpo20.04.1"
+        )
+
+    def test_make_pep440_compliant_ubuntu_security(self) -> None:
+        """Test make_pep440_compliant() with Ubuntu security update."""
+        self.assertEqual(make_pep440_compliant("2.17.12ubuntu1.1"), 
"2.17.12+ubuntu1.1")
diff --git a/python/setup.py b/python/setup.py
index e99945f..d3c9e12 100755
--- a/python/setup.py
+++ b/python/setup.py
@@ -23,10 +23,22 @@ def get_debian_version():
     return version
 
 
+def make_pep440_compliant(version: str) -> str:
+    """Convert the version into a PEP440 compliant version."""
+    public_version_re = 
re.compile(r"^([0-9][0-9.]*(?:(?:a|b|rc|.post|.dev)[0-9]+)*)\+?")
+    _, public, local = public_version_re.split(version, maxsplit=1)
+    if not local:
+        return version
+    sanitized_local = re.sub("[+~]+", ".", local).strip(".")
+    pep440_version = f"{public}+{sanitized_local}"
+    assert re.match("^[a-zA-Z0-9.]+$", sanitized_local), f"'{pep440_version}' 
not PEP440 compliant"
+    return pep440_version
+
+
 if __name__ == "__main__":
     setup(
         name="distro-info",
-        version=get_debian_version(),
+        version=make_pep440_compliant(get_debian_version()),
         py_modules=PY_MODULES,
         packages=PACKAGES,
         test_suite="distro_info_test",
diff --git a/test-debian-distro-info b/test-debian-distro-info
index ace43a2..78f17da 100755
--- a/test-debian-distro-info
+++ b/test-debian-distro-info
@@ -346,10 +346,10 @@ testDays() {
     success "--testing --date=$date --days=release -f" "Debian 7 \"Wheezy\" 1"
     success "--testing --date=$date --days=release -r" "7 1"
 
-    success "--testing --date=$date --days=eol" "1089"
-    success "--testing --date=$date --days=eol -c" "wheezy 1089"
-    success "--testing --date=$date --days=eol -f" "Debian 7 \"Wheezy\" 1089"
-    success "--testing --date=$date --days=eol -r" "7 1089"
+    success "--testing --date=$date --days=eol" "1088"
+    success "--testing --date=$date --days=eol -c" "wheezy 1088"
+    success "--testing --date=$date --days=eol -f" "Debian 7 \"Wheezy\" 1088"
+    success "--testing --date=$date --days=eol -r" "7 1088"
 
     success "--testing --date=$date --days=eol-lts" "1854"
     success "--testing --date=$date --days=eol-lts -c" "wheezy 1854"

Reply via email to