[med-svn] [Git][med-team/q2-types][master] 4 commits: d/patches: Do not fail plugin registration when optional dependencies...

Andreas Tille (@tille) gitlab at salsa.debian.org
Thu Nov 12 16:10:24 GMT 2026



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


Commits:
456d9aed by Andreas Tille at 2026-11-12T13:29:10+01:00
d/patches: Do not fail plugin registration when optional dependencies (pyhmmer, frictionless) are not installed, and ignore only the autopkgtest modules that need those unpackaged modules.

- - - - -
466a5d75 by Andreas Tille at 2026-11-12T13:40:03+01:00
Close bugs

- - - - -
0eb786d7 by Andreas Tille at 2026-11-12T17:01:09+01:00
Add package q2-types-examples Closes: #1065333

- - - - -
ba2a56d5 by Andreas Tille at 2026-11-12T17:02:05+01:00
Upload to experimental

- - - - -


9 changed files:

- debian/changelog
- debian/control
- debian/control.in
- + debian/patches/optional-deps.patch
- + debian/patches/series
- + debian/q2-types-examples.install
- + debian/q2-types.install
- debian/rules
- debian/tests/run-unit-test


Changes:

=====================================
debian/changelog
=====================================
@@ -1,13 +1,11 @@
-q2-types (2026.10.0-1) UNRELEASED; urgency=medium
-
-  TODO:
-    - https://github.com/althonos/pyhmmer
-    - Maybe: https://github.com/frictionlessdata/frictionless-py
+q2-types (2026.10.0-1) experimental; urgency=medium
 
   * Team upload.
   * New upstream version
   * d/watch: version=5
   * cme fix dpkg-control (+ adapt d/control.in)
+  * Do not hardcode Python3.11 any more
+    Closes: #1076316
   * Build-Depends: pybuild-plugin-pyproject (routine-update)
   * Replace FSF postal address with a reference to
     https://www.gnu.org/licenses/.
@@ -17,6 +15,12 @@ q2-types (2026.10.0-1) UNRELEASED; urgency=medium
   * Enhance long description
   * Build-Depends: dh-sequence-single-binary
   * Fix permissions
+  * d/patches: Do not fail plugin registration when optional dependencies
+    (pyhmmer, frictionless) are not installed, and ignore only the
+    autopkgtest modules that need those unpackaged modules.
+    Closes: #1104050
+  * Add package q2-types-examples
+    Closes: #1065333
 
  -- Andreas Tille <tille at debian.org>  Mon, 02 Nov 2026 09:11:22 +0100
 


=====================================
debian/control
=====================================
@@ -10,7 +10,6 @@ Section: science
 Build-Depends:
  debhelper-compat (= 14),
  dh-sequence-python3,
- dh-sequence-single-binary,
  pybuild-plugin-pyproject,
  python3-all,
  python3-biom-format,
@@ -37,7 +36,6 @@ Depends:
  qiime (>= 2026.10),
  ${misc:Depends},
  ${python3:Depends},
- ${shlibs:Depends},
 Description: QIIME 2 plugin defining types for microbiome analysis
  QIIME 2 is a powerful, extensible, and decentralized microbiome analysis
  package with a focus on data and analysis transparency. QIIME 2 enables
@@ -48,7 +46,7 @@ Description: QIIME 2 plugin defining types for microbiome analysis
   * Semantic type system
   * Plugin system for extending microbiome analysis functionality
   * Support for multiple types of user interfaces (e.g. API, command line,
- graphical)
+    graphical)
  .
  QIIME 2 currently supports an initial end-to-end microbiome analysis pipeline.
  New functionality will regularly become available through QIIME 2 plugins. You
@@ -58,3 +56,35 @@ Description: QIIME 2 plugin defining types for microbiome analysis
  .
  This plugin provides the core semantic types used by QIIME 2 plugins to
  exchange microbiome data such as feature tables and phylogenetic trees.
+
+Package: q2-types-examples
+Architecture: all
+Multi-Arch: foreign
+Depends:
+ ${misc:Depends},
+Breaks: q2-types (<< 2024.5.0-2)
+Replaces: q2-types (<< 2024.5.0-2)
+Enhances: q2-types
+Description: QIIME 2 plugin defining types for microbiome analysis (example data)
+ QIIME 2 is a powerful, extensible, and decentralized microbiome analysis
+ package with a focus on data and analysis transparency. QIIME 2 enables
+ researchers to start an analysis with raw DNA sequence data and finish with
+ publication-quality figures and statistical results.
+ Key features:
+  * Integrated and automatic tracking of data provenance
+  * Semantic type system
+  * Plugin system for extending microbiome analysis functionality
+  * Support for multiple types of user interfaces (e.g. API, command line,
+    graphical)
+ .
+ QIIME 2 currently supports an initial end-to-end microbiome analysis pipeline.
+ New functionality will regularly become available through QIIME 2 plugins. You
+ can view a list of plugins that are currently available on the QIIME 2 plugin
+ availability page. The future plugins page lists plugins that are being
+ developed.
+ .
+ This plugin provides the core semantic types used by QIIME 2 plugins to
+ exchange microbiome data such as feature tables and phylogenetic trees.
+ .
+ This package contains reference_db data for q2-types which are not needed for
+ normal operation.


=====================================
debian/control.in
=====================================
@@ -9,7 +9,6 @@ Section: science
 Build-Depends:
  debhelper-compat (= 14),
  dh-sequence-python3,
- dh-sequence-single-binary,
  pybuild-plugin-pyproject,
  python3-all,
  python3-biom-format,
@@ -36,7 +35,6 @@ Depends:
  qiime (>= @DEB_VERSION_UPSTREAM@),
  ${misc:Depends},
  ${python3:Depends},
- ${shlibs:Depends},
 Description: QIIME 2 plugin defining types for microbiome analysis
  QIIME 2 is a powerful, extensible, and decentralized microbiome analysis
  package with a focus on data and analysis transparency. QIIME 2 enables
@@ -47,7 +45,7 @@ Description: QIIME 2 plugin defining types for microbiome analysis
   * Semantic type system
   * Plugin system for extending microbiome analysis functionality
   * Support for multiple types of user interfaces (e.g. API, command line,
- graphical)
+    graphical)
  .
  QIIME 2 currently supports an initial end-to-end microbiome analysis pipeline.
  New functionality will regularly become available through QIIME 2 plugins. You
@@ -57,3 +55,35 @@ Description: QIIME 2 plugin defining types for microbiome analysis
  .
  This plugin provides the core semantic types used by QIIME 2 plugins to
  exchange microbiome data such as feature tables and phylogenetic trees.
+
+Package: q2-types-examples
+Architecture: all
+Multi-Arch: foreign
+Depends:
+ ${misc:Depends},
+Breaks: q2-types (<< 2024.5.0-2)
+Replaces: q2-types (<< 2024.5.0-2)
+Enhances: q2-types
+Description: QIIME 2 plugin defining types for microbiome analysis (example data)
+ QIIME 2 is a powerful, extensible, and decentralized microbiome analysis
+ package with a focus on data and analysis transparency. QIIME 2 enables
+ researchers to start an analysis with raw DNA sequence data and finish with
+ publication-quality figures and statistical results.
+ Key features:
+  * Integrated and automatic tracking of data provenance
+  * Semantic type system
+  * Plugin system for extending microbiome analysis functionality
+  * Support for multiple types of user interfaces (e.g. API, command line,
+    graphical)
+ .
+ QIIME 2 currently supports an initial end-to-end microbiome analysis pipeline.
+ New functionality will regularly become available through QIIME 2 plugins. You
+ can view a list of plugins that are currently available on the QIIME 2 plugin
+ availability page. The future plugins page lists plugins that are being
+ developed.
+ .
+ This plugin provides the core semantic types used by QIIME 2 plugins to
+ exchange microbiome data such as feature tables and phylogenetic trees.
+ .
+ This package contains reference_db data for q2-types which are not needed for
+ normal operation.


=====================================
debian/patches/optional-deps.patch
=====================================
@@ -0,0 +1,54 @@
+Description: Do not fail plugin registration when optional dependencies
+ (pyhmmer, frictionless) are unavailable.
+ The plugin setup imports every submodule eagerly, so a single missing
+ optional dependency makes the whole plugin, and therefore every test
+ using the QIIME 2 plugin test framework, fail to load.  Skip only the
+ submodules whose imports fail with ModuleNotFoundError, leaving all
+ other errors fatal.
+Author: Andreas Tille <tille at debian.org>
+Last-Update: 2026-11-12
+Assisted-By: aim2balance/a2b-code
+--- a/q2_types/plugin_setup.py
++++ b/q2_types/plugin_setup.py
+@@ -7,6 +7,7 @@
+ # ----------------------------------------------------------------------------
+ 
+ import importlib
++import warnings
+ 
+ import pandas as pd
+ 
+@@ -479,21 +480,15 @@
+                 "artifacts containing subsets of the loci",
+ )
+ 
+-importlib.import_module('q2_types.bowtie2._deferred_setup')
+-importlib.import_module('q2_types.distance_matrix._deferred_setup')
+-importlib.import_module('q2_types.feature_data._deferred_setup')
+-importlib.import_module('q2_types.feature_data_mag._deferred_setup')
+-importlib.import_module('q2_types.feature_map._deferred_setup')
+-importlib.import_module('q2_types.feature_table._deferred_setup')
+-importlib.import_module('q2_types.genome_data._deferred_setup')
+-importlib.import_module('q2_types.kaiju._deferred_setup')
+-importlib.import_module('q2_types.kraken2._deferred_setup')
+-importlib.import_module('q2_types.metadata._deferred_setup')
+-importlib.import_module('q2_types.multiplexed_sequences._deferred_setup')
+-importlib.import_module('q2_types.ordination._deferred_setup')
+-importlib.import_module('q2_types.per_sample_sequences._deferred_setup')
+-importlib.import_module('q2_types.profile_hmms._deferred_setup')
+-importlib.import_module('q2_types.reference_db._deferred_setup')
+-importlib.import_module('q2_types.sample_data._deferred_setup')
+-importlib.import_module('q2_types.tree._deferred_setup')
+-importlib.import_module('q2_types.tabular._deferred_setup')
++for _submodule in (
++    'bowtie2', 'distance_matrix', 'feature_data', 'feature_data_mag',
++    'feature_map', 'feature_table', 'genome_data', 'kaiju', 'kraken2',
++    'metadata', 'multiplexed_sequences', 'ordination', 'per_sample_sequences',
++    'profile_hmms', 'reference_db', 'sample_data', 'tree', 'tabular',
++):
++    try:
++        importlib.import_module(f'q2_types.{_submodule}._deferred_setup')
++    except ModuleNotFoundError as e:
++        if (e.name or '').startswith('q2_types'):
++            raise
++        warnings.warn(f'q2_types.{_submodule} not registered: {e}')


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


=====================================
debian/q2-types-examples.install
=====================================
@@ -0,0 +1 @@
+usr/lib/python3*/dist-packages/q2_types/reference_db/*


=====================================
debian/q2-types.install
=====================================
@@ -0,0 +1 @@
+usr/lib/python3*/dist-packages/q2_types*


=====================================
debian/rules
=====================================
@@ -6,8 +6,6 @@ export LC_ALL=C.UTF-8
 include /usr/share/dpkg/default.mk
 VERSION_UPSTREAM=$(shell echo $(DEB_VERSION_UPSTREAM) | sed -e 's/\(20[0-9][0-9]\.[0-9]\+\)\..*/\1/')
 
-export PYBUILD_DISABLE=python3.12
-
 # For testing, we need .egg-info so the entry points are available.
 export PYBUILD_BEFORE_TEST=python{version} setup.py develop --install-dir {build_dir}
 # Delete .egg-info and other files that were generated along with .egg-info
@@ -30,7 +28,9 @@ override_dh_auto_test:
 #	dh_auto_test -- -s custom --test-args="cd {build_dir}; pytest --cov=q2_types"
 #endif
 
-execute_after_dh_install:
+override_dh_install:
+	dh_install -pq2-types --exclude=/reference_db
+	dh_install -pq2-types-examples
 	find debian -name ".coverage*" -delete
 
 execute_after_dh_auto_clean:


=====================================
debian/tests/run-unit-test
=====================================
@@ -21,5 +21,30 @@ fi
 # for py in $(py3versions -s 2> /dev/null) # FIXME: qiime 3.12 issue reported in https://github.com/qiime2/qiime2/issues/751
 for py in $(py3versions -d 2> /dev/null)
 do
-    ${py} -m pytest -v  --cov=${pkg}
+    # Test modules that import a python module not yet packaged in Debian
+    # would abort the whole run at collection time.  Ignore just those.
+    # Each failing module is probed in a fresh interpreter, since imports
+    # left behind by an earlier module can mask the missing one.  Any
+    # other import failure is left to pytest, so genuine bugs still fail.
+    ignores=()
+    while : ; do
+        new=0
+        errs=$(${py} -m pytest --collect-only -q "${ignores[@]}" 2>&1 || true)
+        for f in $(sed -n 's/^ERROR \(q2_types\/.*\.py\).*/\1/p' \
+                   <<<"${errs}" | sort -u); do
+            mod=${f%.py}
+            mod=${mod//\//.}
+            out=$(${py} -c "import ${mod}" 2>&1 || true)
+            miss=$(sed -n "s/.*No module named '\([^']*\)'.*/\1/p" \
+                   <<<"${out}" | tail -1)
+            if [ -n "${miss}" ] && [[ ${miss} != ${pkg}* ]] ; then
+                echo "Ignoring ${f}: ${miss} not packaged in Debian"
+                ignores+=(--ignore="${f}")
+                new=1
+            fi
+        done
+        [ ${new} = 1 ] || break
+    done
+
+    ${py} -m pytest -v --cov=${pkg} "${ignores[@]}"
 done



View it on GitLab: https://salsa.debian.org/med-team/q2-types/-/compare/54a4c9b44a7bf7e1a26ca04a729e7cc6224202e4...ba2a56d5fec38d3c9ba1067ebdac70d9c51ebab2

-- 
View it on GitLab: https://salsa.debian.org/med-team/q2-types/-/compare/54a4c9b44a7bf7e1a26ca04a729e7cc6224202e4...ba2a56d5fec38d3c9ba1067ebdac70d9c51ebab2
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/20261112/fc48e61d/attachment-0001.htm>


More information about the debian-med-commit mailing list