Bug#1023978: scikit-learn: FTBFS with Python 3.11 as a supported version

Paul Wise pabs at debian.org
Sun Dec 4 08:03:51 GMT 2022


Control: tags -1 + fixed-upstream patch
Control: forwarded -1 https://github.com/scikit-learn/scikit-learn/commit/63f92d4adb61aed58d656544cc6caa9d68cb6065

On Sun, 13 Nov 2022 12:26:18 +0000 Graham Inggs wrote:

> scikit-learn FTBFS with Python 3.11 as a supported version.

I noticed that upstream has some commits adding 3.11 support,
but none of them seem like they would fix the build failure.

Looking at the changes to the file with the failing test I found the
commit above and then confirmed that this hunk from it fixes the build.

--- a/sklearn/datasets/tests/test_lfw.py
+++ b/sklearn/datasets/tests/test_lfw.py
@@ -84,8 +84,8 @@ def setup_module():
 
         for i in range(5):
             first_name, second_name = random_state.sample(FAKE_NAMES, 2)
-            first_index = random_state.choice(np.arange(counts[first_name]))
-            second_index = random_state.choice(np.arange(counts[second_name]))
+            first_index = np_rng.choice(np.arange(counts[first_name]))
+            second_index = np_rng.choice(np.arange(counts[second_name]))
             f.write(
                 (
                     "%s\t%d\t%s\t%d\n"

-- 
bye,
pabs

https://wiki.debian.org/PaulWise
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://alioth-lists.debian.net/pipermail/debian-science-maintainers/attachments/20221204/6ed0e089/attachment.sig>


More information about the debian-science-maintainers mailing list