[med-svn] [Git][python-team/packages/python-pynndescent][master] 5 commits: Cherry-pick from an upstream commit to fix the sokalmichener removal.

Michael R. Crusoe (@crusoe) gitlab at salsa.debian.org
Wed Aug 19 09:27:06 BST 2026



Michael R. Crusoe pushed to branch master at Debian Python Team / packages / python-pynndescent


Commits:
41402c06 by Michael R. Crusoe at 2026-08-19T09:35:21+03:00
Cherry-pick from an upstream commit to fix the sokalmichener removal.

Closes: #1135062

- - - - -
143b84f2 by Michael R. Crusoe at 2026-08-19T10:06:47+03:00
d/control: build using pyproject (PEP-517).

- - - - -
3a65ac98 by Michael R. Crusoe at 2026-08-19T10:10:37+03:00
Install the tests, and use them as autopkgtests.

- - - - -
6488c8ed by Michael R. Crusoe at 2026-08-19T10:13:20+03:00
Changes made by cme

- - - - -
591f3691 by Michael R. Crusoe at 2026-08-19T11:26:11+03:00
routine-update: Ready to upload to unstable

- - - - -


8 changed files:

- debian/changelog
- debian/control
- + debian/patches/install-tests
- debian/patches/series
- + debian/patches/sokalmichener-deprecated.patch
- debian/rules
- − debian/tests/control
- − debian/tests/run-unit-test


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,14 @@
+python-pynndescent (0.6.0-2) unstable; urgency=medium
+
+  * Team upload.
+  * Cherry-pick from an upstream commit to fix the sokalmichener
+    removal. Closes: #1135062
+  * d/control: build using pyproject (PEP-517).
+  * Install the tests, and use them as autopkgtests.
+  * Reflow Uploaders field (cme)
+
+ -- Michael R. Crusoe <crusoe at debian.org>  Wed, 19 Aug 2026 10:14:28 +0300
+
 python-pynndescent (0.6.0-1) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/control
=====================================
@@ -1,25 +1,31 @@
 Source: python-pynndescent
+Standards-Version: 4.7.4
 Maintainer: Debian Python Team <team+python at tracker.debian.org>
-Uploaders: Andreas Tille <tille at debian.org>
+Uploaders:
+ Andreas Tille <tille at debian.org>,
 Section: python
-Build-Depends: debhelper-compat (= 13),
-               dh-sequence-python3,
-               python3-all,
-               python3-joblib <!nocheck>,
-               python3-llvmlite <!nocheck>,
-               python3-numba <!nocheck>,
-               python3-pytest <!nocheck>,
-               python3-scipy <!nocheck>,
-               python3-setuptools,
-               python3-sklearn <!nocheck>
-Standards-Version: 4.7.4
+Testsuite: autopkgtest-pkg-pybuild
+Build-Depends:
+ debhelper-compat (= 13),
+ dh-sequence-python3,
+ pybuild-plugin-pyproject,
+ python3-all,
+ python3-joblib <!nocheck>,
+ python3-llvmlite <!nocheck>,
+ python3-numba <!nocheck>,
+ python3-pytest <!nocheck>,
+ python3-scipy <!nocheck>,
+ python3-setuptools,
+ python3-sklearn <!nocheck>,
 Vcs-Browser: https://salsa.debian.org/python-team/packages/python-pynndescent
 Vcs-Git: https://salsa.debian.org/python-team/packages/python-pynndescent.git
 Homepage: https://github.com/lmcinnes/pynndescent/
 
 Package: python3-pynndescent
 Architecture: any-amd64 alpha arm64 ia64 loong64 mips64el ppc64 ppc64el riscv64 s390x sparc64
-Depends: ${misc:Depends}, ${python3:Depends}
+Depends:
+ ${misc:Depends},
+ ${python3:Depends},
 Description: nearest neighbor descent for approximate nearest neighbors
  PyNNDescent is a Python nearest neighbor descent for approximate nearest
  neighbors. It provides a Python implementation of Nearest Neighbor


=====================================
debian/patches/install-tests
=====================================
@@ -0,0 +1,17 @@
+From: Michael R. Crusoe <crusoe at debian.org>
+Subject: Install the tests
+Forwarded: https://github.com/lmcinnes/pynndescent/pull/265
+--- python-pynndescent.orig/pyproject.toml
++++ python-pynndescent/pyproject.toml
+@@ -40,6 +40,9 @@
+ testing = ["pytest"]
+ 
+ [tool.setuptools]
+-packages = ["pynndescent"]
++packages = ["pynndescent", "pynndescent.tests", "pynndescent.tests.test_data"]
+ zip-safe = false
+-include-package-data = false
++include-package-data = true
++
++[tool.setuptools.package-data]
++"pynndescent.test.test_data" = ["*.np*"]


=====================================
debian/patches/series
=====================================
@@ -1 +1,3 @@
 arm.patch
+sokalmichener-deprecated.patch
+install-tests


=====================================
debian/patches/sokalmichener-deprecated.patch
=====================================
@@ -0,0 +1,49 @@
+From b4ec5d52c22f5d9097761fa0b3778e76078b4c76 Mon Sep 17 00:00:00 2001
+From: gclendenning <64431984+gclendenning at users.noreply.github.com>
+Date: Mon, 20 Apr 2026 20:19:45 +0000
+Subject: fix tests using deprecated sokalmichener metric
+Origin: upstream, https://github.com/lmcinnes/pynndescent/commit/b4ec5d52c22f5d9097761fa0b3778e76078b4c76.patch
+---
+
+--- python-pynndescent.orig/pynndescent/tests/test_distances.py
++++ python-pynndescent/pynndescent/tests/test_distances.py
+@@ -67,7 +67,12 @@
+     ],
+ )
+ def test_binary_check(binary_data, metric):
+-    dist_matrix = pairwise_distances(binary_data, metric=metric)
++    # In never versions of scipy sokalmichener was deprecated for rogerstanimoto
++    # They should be the same in scipy's implementation
++    if metric == 'sokalmichener':
++        dist_matrix = pairwise_distances(binary_data, metric='rogerstanimoto')
++    else:
++        dist_matrix = pairwise_distances(binary_data, metric=metric)
+     if metric in ("jaccard", "dice", "sokalsneath", "yule"):
+         dist_matrix[np.where(~np.isfinite(dist_matrix))] = 0.0
+     if metric == "russellrao":
+@@ -176,9 +181,14 @@
+ )
+ def test_sparse_binary_check(sparse_binary_data, metric):
+     if metric in spdist.sparse_named_distances:
+-        dist_matrix = pairwise_distances(
+-            np.asarray(sparse_binary_data.todense()), metric=metric
+-        )
++        if metric == "sokalmichener":
++            dist_matrix = pairwise_distances(
++                np.asarray(sparse_binary_data.todense()), metric="rogerstanimoto"
++            )        
++        else:
++            dist_matrix = pairwise_distances(
++                np.asarray(sparse_binary_data.todense()), metric=metric
++            )
+     if metric in ("jaccard", "dice", "sokalsneath"):
+         dist_matrix[np.where(~np.isfinite(dist_matrix))] = 0.0
+     if metric == "russellrao":
+@@ -186,6 +196,7 @@
+         # And because distance between all zero vectors should be zero
+         dist_matrix[10, 11] = 0.0
+         dist_matrix[11, 10] = 0.0
++    
+ 
+     dist_function = spdist.sparse_named_distances[metric]
+     if metric in spdist.sparse_need_n_features:


=====================================
debian/rules
=====================================
@@ -1,19 +1,7 @@
 #!/usr/bin/make -f
 
-include /usr/share/dpkg/pkg-info.mk
-
 export PYBUILD_NAME=pynndescent
-export PYTHONPATH=$(CURDIR)
+export PYBUILD_TEST_ARGS=--pyargs pynndescent.tests
 
 %:
 	dh $@ --buildsystem=pybuild
-
-# Avoid chicken-egg problem with importlib.metadata.version()
-override_dh_auto_build:
-	sed -i "s/^__version__.*/__version__ = '$(DEB_VERSION_UPSTREAM)'/" pynndescent/__init__.py
-	dh_auto_build
-
-override_dh_auto_test:
-ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-	dh_auto_test -- --system=custom --test-args="PYTHONPATH={build_dir} {interpreter} -m pytest -v $(CURDIR)/pynndescent/tests"
-endif


=====================================
debian/tests/control deleted
=====================================
@@ -1,4 +0,0 @@
-Tests: run-unit-test
-Depends: python3-all, python3-pytest, @
-Restrictions: allow-stderr
-Architecture: alpha amd64 arm64 ia64 loong64 mips64el ppc64 ppc64el riscv64 s390x sparc64


=====================================
debian/tests/run-unit-test deleted
=====================================
@@ -1,10 +0,0 @@
-#!/bin/bash
-set -e
-
-SOURCE=$(pwd)
-for py in $(py3versions -s 2>/dev/null)
-do
-    cd "$AUTOPKGTEST_TMP"
-    echo "Testing with $py:"
-    http_proxy= $py -m pytest ${SOURCE}/pynndescent/tests
-done



View it on GitLab: https://salsa.debian.org/python-team/packages/python-pynndescent/-/compare/b6b63d6a0792f8c943ec57ea422f8ed83cf8af02...591f3691d981a9db226a54eac2f37d0194ef4595

-- 
View it on GitLab: https://salsa.debian.org/python-team/packages/python-pynndescent/-/compare/b6b63d6a0792f8c943ec57ea422f8ed83cf8af02...591f3691d981a9db226a54eac2f37d0194ef4595
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


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


More information about the debian-med-commit mailing list