[med-svn] [Git][med-team/python-skbio][master] Cherry-picked patch from upstream to fix test that failed under Python 3.13.

Michael R. Crusoe (@crusoe) gitlab at salsa.debian.org
Mon Nov 18 10:11:09 GMT 2024



Michael R. Crusoe pushed to branch master at Debian Med / python-skbio


Commits:
1cdaed1e by Michael R. Crusoe at 2024-11-18T09:59:20+00:00
Cherry-picked patch from upstream to fix test that failed under Python 3.13.

Closes: #1087690

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/45127698e270024bacb670cdd0bd2e4850104b6f.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+python-skbio (0.6.2-4) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * Cherry-picked patch from upstream to fix test that failed under Python
+    3.13. Closes: #1087690
+
+ -- Michael R. Crusoe <crusoe at debian.org>  Mon, 18 Nov 2024 09:55:29 +0000
+
 python-skbio (0.6.2-3) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/patches/45127698e270024bacb670cdd0bd2e4850104b6f.patch
=====================================
@@ -0,0 +1,90 @@
+From 45127698e270024bacb670cdd0bd2e4850104b6f Mon Sep 17 00:00:00 2001
+From: Matt Aton <matthewaton2 at gmail.com>
+Date: Wed, 6 Nov 2024 17:31:40 -0700
+Subject: [PATCH] Python 3.13 Support (#2146)
+
+* Rewrite tests and add Python 3.13 to CI workflow
+
+* Update CHANGELOG
+
+* Make doctest for permdisp pass on different platforms
+---
+ .github/workflows/ci.yml          |  4 +--
+ .github/workflows/release.yml     |  2 +-
+ .github/workflows/website.yml     |  2 +-
+ CHANGELOG.md                      |  1 +
+ setup.py                          |  1 +
+ skbio/stats/distance/_permdisp.py |  4 +--
+ skbio/util/tests/test_misc.py     | 43 ++++++++++++++++++-------------
+ 7 files changed, 33 insertions(+), 24 deletions(-)
+
+
+--- a/setup.py
++++ b/setup.py
+@@ -129,6 +129,7 @@
+     Programming Language :: Python :: 3.10
+     Programming Language :: Python :: 3.11
+     Programming Language :: Python :: 3.12
++    Programming Language :: Python :: 3.13
+     Operating System :: Unix
+     Operating System :: POSIX
+     Operating System :: MacOS :: MacOS X
+--- a/skbio/util/tests/test_misc.py
++++ b/skbio/util/tests/test_misc.py
+@@ -8,6 +8,7 @@
+ 
+ import io
+ import unittest
++import re
+ 
+ import numpy as np
+ 
+@@ -103,24 +104,30 @@
+         self.registry.interpolate(SomethingToInterpolate, "interpolate_me")
+         subclass_registry.interpolate(Subclass, "interpolate_me")
+ 
+-        self.assertEqual(SomethingToInterpolate.interpolate_me.__doc__,
+-                         "First line\n\n                Some description of th"
+-                         "ings, also this:\n\n\t'a'\n\t  x\n\t'b'\n\t  y\n\t'c"
+-                         "'\n\t  z\n\n                Other things are happeni"
+-                         "ng now.\n                ")
+-        self.assertEqual(SomethingToInterpolate.dont_interpolate_me.__doc__,
+-                         "First line\n\n                Some description of th"
+-                         "ings, also this:\n\n                Other things are"
+-                         " happening now.\n                ")
+-        self.assertEqual(Subclass.interpolate_me.__doc__,
+-                         "First line\n\n                Some description of th"
+-                         "ings, also this:\n\n\t'a'\n\t  x\n\t'b'\n\t  y\n\t'c"
+-                         "'\n\t  z\n\t'o'\n\t  p\n\n                Other thin"
+-                         "gs are happening now.\n                ")
+-        self.assertEqual(Subclass.dont_interpolate_me.__doc__,
+-                         "First line\n\n                Some description of th"
+-                         "ings, also this:\n\n                Other things are"
+-                         " happening now.\n                ")
++        # Python 3.13+ removes leading whitespaces from a docstring, therefore it is
++        # necessary to make this edit.
++        def _strip_spaces(s):
++            return re.sub(r'^\s+', '', s, flags=re.MULTILINE)
++
++        obs = _strip_spaces(SomethingToInterpolate.interpolate_me.__doc__)
++        exp = ("First line\nSome description of things, also this:\n'a'\nx"
++               "\n'b'\ny\n'c'\nz\nOther things are happening now.\n")
++        self.assertEqual(obs, exp)
++
++        obs = _strip_spaces(SomethingToInterpolate.dont_interpolate_me.__doc__)
++        exp = ("First line\nSome description of things, also this:\nOther things "
++               "are happening now.\n")
++        self.assertEqual(obs, exp)
++
++        obs = _strip_spaces(Subclass.interpolate_me.__doc__)
++        exp = ("First line\nSome description of things, also this:\n'a'\nx\n'b'\ny\n"
++               "'c'\nz\n'o'\np\nOther things are happening now.\n")
++        self.assertEqual(obs, exp)
++
++        obs = _strip_spaces(Subclass.dont_interpolate_me.__doc__)
++        exp = ("First line\nSome description of things, also this:\nOther things "
++               "are happening now.\n")
++        self.assertEqual(obs, exp)
+ 
+ 
+ class ResolveKeyTests(unittest.TestCase):


=====================================
debian/patches/series
=====================================
@@ -5,3 +5,4 @@ no_privacy_breach_logo.patch
 local_inventory
 docs-no-version-switch
 0007-Fix-cython-segmentation-error-2090.patch
+45127698e270024bacb670cdd0bd2e4850104b6f.patch



View it on GitLab: https://salsa.debian.org/med-team/python-skbio/-/commit/1cdaed1edf1d4ec5c9086ca666e064821a13bf6f

-- 
View it on GitLab: https://salsa.debian.org/med-team/python-skbio/-/commit/1cdaed1edf1d4ec5c9086ca666e064821a13bf6f
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20241118/00413b4c/attachment-0001.htm>


More information about the debian-med-commit mailing list