Andreas Tille pushed to branch master at Debian Med / q2-feature-table


Commits:
d6acd1f3 by Andreas Tille at 2026-11-16T17:10:40+01:00
Add patch making the rnanorm dependency optional

FIXME: This patch has to be reverted once python-rnanorm is in unstable

Without rnanorm the whole q2_feature_table package fails to import,
which breaks every test module during pytest collection (all 18 tests
failed with ModuleNotFoundError).  Guard the import so the rest of the
plugin remains usable and skip the normalize tests until rnanorm is
packaged for Debian.

- - - - -
81ad284e by Andreas Tille at 2026-11-16T17:18:37+01:00
d/watch: add repack index

- - - - -
0aa7acab by Andreas Tille at 2026-11-16T17:19:03+01:00
New upstream version 2026.10.0+dfsg
- - - - -
0e01d5d2 by Andreas Tille at 2026-11-16T17:19:04+01:00
Update upstream source from tag 'upstream/2026.10.0+dfsg'

Update to upstream version '2026.10.0+dfsg'
with Debian dir a997434484f7bf2612943fc54a8b131b7a53a89a
- - - - -
9776cc89 by Andreas Tille at 2026-11-16T17:45:54+01:00
Test-Depends: python3-selenium

- - - - -


5 changed files:

- debian/changelog
- + debian/patches/optional-rnanorm.patch
- + debian/patches/series
- debian/tests/control
- debian/watch


Changes:

=====================================
debian/changelog
=====================================
@@ -1,8 +1,8 @@
-q2-feature-table (2026.10.0-1) UNRELEASED; urgency=medium
+q2-feature-table (2026.10.0+dfsg-1) UNRELEASED; urgency=medium
 
   * Team upload.
   * Revert restriction to specific Python version
-  * d/watch: version=5
+  * d/watch: version=5, add repack index
   * cme fix dpkg-control (+ adapt d/control.in)
   * New upstream version
   * Build-Depends: pybuild-plugin-pyproject (routine-update)
@@ -11,6 +11,9 @@ q2-feature-table (2026.10.0-1) UNRELEASED; urgency=medium
     https://www.gnu.org/licenses/.
   * Regenerate debian/control from debian/control.in (routine-update)
   * Build-Depends: dh-sequence-single-binary
+  * Test-Depends: python3-selenium
+  * Patch to make rnanorm optional
+    FIXME: This patch has to be reverted once python-rnanorm is in unstable
 
  -- Andreas Tille <[email protected]>  Mon, 02 Nov 2026 18:30:39 +0100
 


=====================================
debian/patches/optional-rnanorm.patch
=====================================
@@ -0,0 +1,66 @@
+Description: make the rnanorm dependency optional
+ The 'normalize' action relies on rnanorm which is not yet packaged
+ for Debian.  Without rnanorm the whole q2_feature_table package fails
+ to import, which breaks every test module during collection.  Guard
+ the import so the rest of the plugin (rarefy, filter, merge, ...)
+ remains usable and skip the normalize tests until rnanorm is
+ packaged.
+Author: Andreas Tille <[email protected]>
+Last-Update: 2026-11-16
+Comment: FIXME: This patch has to be dropped once python-rnanorm is in unstable
+
+---
+diff --git a/q2_feature_table/_normalize.py b/q2_feature_table/_normalize.py
+index 98d5f33..2fdef1c 100644
+--- a/q2_feature_table/_normalize.py
++++ b/q2_feature_table/_normalize.py
+@@ -11,7 +11,13 @@ import pandas as pd
+ 
+ from rachis.plugin import CaptureHolder, get_np_random_seed
+ from q2_types.feature_data import SequenceCharacteristicsDirectoryFormat
+-from rnanorm import CPM, CTF, CUF, FPKM, TMM, TPM, UQ
++
++try:
++    from rnanorm import CPM, CTF, CUF, FPKM, TMM, TPM, UQ
++except ImportError:  # pragma: no cover
++    # rnanorm is not yet packaged for Debian; only the 'normalize'
++    # action is affected, the rest of the plugin must still import.
++    CPM = CTF = CUF = FPKM = TMM = TPM = UQ = None
+ 
+ 
+ def rarefy(table: biom.Table,
+@@ -43,6 +49,11 @@ def normalize(
+     a_trim: float = None,
+     gene_length: SequenceCharacteristicsDirectoryFormat = None,
+ ) -> pd.DataFrame:
++    # rnanorm is not available, e.g. it is not (yet) packaged for Debian
++    if CPM is None:
++        raise ImportError(
++            "The 'normalize' action requires the 'rnanorm' Python "
++            "package, which is not installed.")
+     # Validate parameter combinations and set trim parameters
+     m_trim, a_trim = _validate_parameters(
+         method, m_trim, a_trim, gene_length)
+diff --git a/q2_feature_table/tests/test_normalize.py 
b/q2_feature_table/tests/test_normalize.py
+index 88e71cf..449eef1 100644
+--- a/q2_feature_table/tests/test_normalize.py
++++ b/q2_feature_table/tests/test_normalize.py
+@@ -9,6 +9,8 @@ import os
+ from unittest import TestCase, main
+ from unittest.mock import MagicMock, patch
+ 
++import pytest
++
+ import numpy as np
+ import numpy.testing as npt
+ import pandas as pd
+@@ -16,6 +18,9 @@ from biom.table import Table
+ from pandas._testing import assert_series_equal
+ from q2_types.feature_data import SequenceCharacteristicsDirectoryFormat
+ 
++# rnanorm is not yet packaged for Debian: skip these tests until it is.
++pytest.importorskip("rnanorm")
++
+ from q2_feature_table import rarefy
+ from q2_feature_table._normalize import (_validate_parameters,
+                                          _convert_lengths, normalize)


=====================================
debian/patches/series
=====================================
@@ -0,0 +1 @@
+optional-rnanorm.patch


=====================================
debian/tests/control
=====================================
@@ -1,3 +1,3 @@
 Tests: run-unit-test
-Depends: @, python3-pytest-cov, python3-all
+Depends: @, python3-pytest-cov, python3-all, python3-selenium
 Restrictions: allow-stderr


=====================================
debian/watch
=====================================
@@ -3,3 +3,5 @@ Version: 5
 Template: Github
 Dist: https://github.com/qiime2/@PACKAGE@
 Custom-Version: (\d[\d.]+)
+Repack-Suffix: +dfsg
+Dversion-Mangle: auto



View it on GitLab: 
https://salsa.debian.org/med-team/q2-feature-table/-/compare/8efa24e81c092c0d10428590745f72312b7acd36...9776cc891e69b430aded0b18a3836a3e242daf8a

-- 
View it on GitLab: 
https://salsa.debian.org/med-team/q2-feature-table/-/compare/8efa24e81c092c0d10428590745f72312b7acd36...9776cc891e69b430aded0b18a3836a3e242daf8a
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


_______________________________________________
debian-med-commit mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-commit

Reply via email to