[med-svn] [Git][med-team/q2-phylogeny][master] 9 commits: Autopkgtest for all supported Python3 versions

Andreas Tille (@tille) gitlab at salsa.debian.org
Sun Feb 18 14:25:19 GMT 2024



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


Commits:
d3d270f9 by Andreas Tille at 2024-02-18T15:15:27+01:00
Autopkgtest for all supported Python3 versions

- - - - -
2af927ae by Andreas Tille at 2024-02-18T15:15:50+01:00
New upstream version 2024.2.0
- - - - -
0b185afe by Andreas Tille at 2024-02-18T15:15:50+01:00
routine-update: New upstream version

- - - - -
ed7c0486 by Andreas Tille at 2024-02-18T15:15:50+01:00
Update upstream source from tag 'upstream/2024.2.0'

Update to upstream version '2024.2.0'
with Debian dir 6f80f340a4bd6d3840cf77c90c5b78cc9bc4f102
- - - - -
60047784 by Andreas Tille at 2024-02-18T14:15:53+00:00
Remove duplicate line from changelog.

Changes-By: lintian-brush

- - - - -
44101509 by Andreas Tille at 2024-02-18T14:15:53+00:00
Remove unnecessary Team Upload line in changelog.

Changes-By: lintian-brush

- - - - -
b442b1a6 by Andreas Tille at 2024-02-18T15:16:24+01:00
routine-update: Regenerate debian/control from debian/control.in

- - - - -
6cf64aad by Andreas Tille at 2024-02-18T15:21:08+01:00
Refresh patches

- - - - -
8e0e5957 by Andreas Tille at 2024-02-18T15:22:54+01:00
Upload to unstable

- - - - -


14 changed files:

- .github/workflows/ci-dev.yaml
- README.md
- debian/changelog
- debian/control
- debian/patches/fix-tests-and-binary-names-and-options.patch
- debian/patches/iqtree2.patch
- debian/tests/control
- debian/tests/run-unit-test
- q2_phylogeny/_fasttree.py
- q2_phylogeny/_iqtree.py
- q2_phylogeny/_raxml.py
- q2_phylogeny/_version.py
- q2_phylogeny/plugin_setup.py
- q2_phylogeny/tests/test_iqtree.py


Changes:

=====================================
.github/workflows/ci-dev.yaml
=====================================
@@ -9,4 +9,4 @@ jobs:
   ci:
     uses: qiime2/distributions/.github/workflows/lib-ci-dev.yaml at dev
     with:
-      distro: core
\ No newline at end of file
+      distro: amplicon
\ No newline at end of file


=====================================
README.md
=====================================
@@ -1,5 +1,5 @@
 # q2-phylogeny
 
-![](https://github.com/qiime2/q2-phylogeny/workflows/ci/badge.svg)
+![](https://github.com/qiime2/q2-phylogeny/workflows/ci-dev/badge.svg)
 
 This is a QIIME 2 plugin. For details on QIIME 2, see https://qiime2.org.
\ No newline at end of file


=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+q2-phylogeny (2024.2.0-1) unstable; urgency=medium
+
+  * New upstream version
+  * Autopkgtest for all supported Python3 versions
+  * Regenerate debian/control from debian/control.in (routine-update)
+
+ -- Andreas Tille <tille at debian.org>  Sun, 18 Feb 2024 15:21:19 +0100
+
 q2-phylogeny (2023.9.0-1) unstable; urgency=medium
 
   * New upstream version


=====================================
debian/control
=====================================
@@ -28,8 +28,8 @@ Depends: ${shlibs:Depends},
          iqtree,
          mafft,
          raxml,
-         q2-types (>= 2023.9),
-         q2-alignment (>= 2023.9)
+         q2-types (>= 2024.2),
+         q2-alignment (>= 2024.2)
 Description: QIIME 2 plugin for phylogeny
  QIIME 2 plugin for phylogenetic reconstruction, and operations on
  phylogenetic trees.


=====================================
debian/patches/fix-tests-and-binary-names-and-options.patch
=====================================
@@ -8,7 +8,7 @@ Forwarded: not-needed
 Last-Update: 2021-07-18
 --- a/q2_phylogeny/tests/test_raxml.py
 +++ b/q2_phylogeny/tests/test_raxml.py
-@@ -88,37 +88,13 @@
+@@ -88,37 +88,13 @@ class RaxmlTests(TestPluginBase):
          self.assertTrue('raxmlHPC' in str(obs_stand_1[0]))
          self.assertTrue(len(obs_stand_1) == 1)
  
@@ -49,7 +49,7 @@ Last-Update: 2021-07-18
          # load the resulting tree and test that it has the right number of
 --- a/q2_phylogeny/_fasttree.py
 +++ b/q2_phylogeny/_fasttree.py
-@@ -42,7 +42,7 @@
+@@ -42,7 +42,7 @@ def fasttree(alignment: AlignedDNAFASTAF
              env.pop('OMP_NUM_THREADS', 0)
          else:
              env.update({'OMP_NUM_THREADS': str(n_threads)})
@@ -60,21 +60,21 @@ Last-Update: 2021-07-18
      run_command(cmd, tree_fp, env=env)
 --- a/q2_phylogeny/_iqtree.py
 +++ b/q2_phylogeny/_iqtree.py
-@@ -75,7 +75,7 @@
-             '-pre', str(run_prefix)]
+@@ -81,7 +81,7 @@ def _build_iqtree_command(
+         cmd += ['-nt', '%i' % n_cores]
  
-     if n_cores == 'auto' and n_cores_max:
--        cmd += ['-nt', 'AUTO', '--threads-max', '%i' % n_cores_max]
-+        cmd += ['-nt', 'AUTO', '-ntmax', '%i' % n_cores_max]
-     elif n_cores == 'auto' and n_cores_max is None:
-         cmd += ['-nt', 'AUTO']
-     else:
-@@ -217,7 +217,7 @@
-             '-pre', str(run_prefix)]
+     if n_cores_max is not None and n_cores_max > 0:
+-        cmd += ['--threads-max', '%i' % n_cores_max]
++        cmd += ['-ntmax', '%i' % n_cores_max]
  
-     if n_cores == 'auto' and n_cores_max:
--        cmd += ['-nt', 'AUTO', '--threads-max', '%i' % n_cores_max]
-+        cmd += ['-nt', 'AUTO', '-ntmax', '%i' % n_cores_max]
-     elif n_cores == 'auto' and n_cores_max is None:
-         cmd += ['-nt', 'AUTO']
-     else:
+     if seed:
+         cmd += ['-seed', '%i' % seed]
+@@ -224,7 +224,7 @@ def _build_iqtree_ufbs_command(
+         cmd += ['-nt', '%i' % n_cores]
+ 
+     if n_cores_max is not None and n_cores_max > 0:
+-        cmd += ['--threads-max', '%i' % n_cores_max]
++        cmd += ['-ntmax', '%i' % n_cores_max]
+ 
+     if seed:
+         cmd += ['-seed', '%i' % seed]


=====================================
debian/patches/iqtree2.patch
=====================================
@@ -3,9 +3,9 @@ Author: Andreas Tille <tille at debian.org>
 Forwarded: not-needed
 Last-Update: Wed, 20 Jul 2022 14:54:54 +0200
 
---- q2-phylogeny.orig/q2_phylogeny/_iqtree.py
-+++ q2-phylogeny/q2_phylogeny/_iqtree.py
-@@ -66,7 +66,7 @@
+--- a/q2_phylogeny/_iqtree.py
++++ b/q2_phylogeny/_iqtree.py
+@@ -66,7 +66,7 @@ def _build_iqtree_command(
          lbp: int = _iqtree_defaults['lbp'],
          safe: bool = _iqtree_defaults['safe']):
  
@@ -14,7 +14,7 @@ Last-Update: Wed, 20 Jul 2022 14:54:54 +0200
  
      cmd += ['-st', str(dtype),
              '--runs', '%i' % n_runs,
-@@ -208,7 +208,7 @@
+@@ -210,7 +210,7 @@ def _build_iqtree_ufbs_command(
      # This is a separate command becuase there are several
      # bootstrap specific options.
  
@@ -23,9 +23,9 @@ Last-Update: Wed, 20 Jul 2022 14:54:54 +0200
  
      cmd += ['-st', str(dtype),
              '--runs', '%i' % n_runs,
---- q2-phylogeny.orig/q2_phylogeny/tests/test_iqtree.py
-+++ q2-phylogeny/q2_phylogeny/tests/test_iqtree.py
-@@ -414,7 +414,7 @@
+--- a/q2_phylogeny/tests/test_iqtree.py
++++ b/q2_phylogeny/tests/test_iqtree.py
+@@ -414,7 +414,7 @@ class IqtreeRunCommandTests(TestPluginBa
  
          with tempfile.TemporaryDirectory() as temp_dir:
              run_prefix = os.path.join(temp_dir, 'q2iqtree')
@@ -34,7 +34,7 @@ Last-Update: Wed, 20 Jul 2022 14:54:54 +0200
                     '-m', 'HKY',
                     '-seed', '1723',
                     '-s', aligned_fp,
-@@ -444,7 +444,7 @@
+@@ -444,7 +444,7 @@ class IqtreeRunCommandTests(TestPluginBa
  
          with tempfile.TemporaryDirectory() as temp_dir:
              run_prefix = os.path.join(temp_dir, 'q2iqtreeufboot')


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


=====================================
debian/tests/run-unit-test
=====================================
@@ -18,4 +18,7 @@ if [ ! -f /usr/lib/python3/dist-packages/pytest_cov/__init__.py ] ; then
 fi
 
 # Run build-time tests
-py.test-3 --cov=${pkg}
+for py in $(py3versions -s 2> /dev/null)
+do
+    ${py} -m pytest -v  --cov=${pkg}
+done


=====================================
q2_phylogeny/_fasttree.py
=====================================
@@ -38,7 +38,7 @@ def fasttree(alignment: AlignedDNAFASTAFormat,
         cmd = ['FastTree']
     else:
         env = os.environ.copy()
-        if n_threads == 'auto':
+        if n_threads == 0:
             env.pop('OMP_NUM_THREADS', 0)
         else:
             env.update({'OMP_NUM_THREADS': str(n_threads)})


=====================================
q2_phylogeny/_iqtree.py
=====================================
@@ -74,13 +74,15 @@ def _build_iqtree_command(
             '-m', str(substitution_model),
             '-pre', str(run_prefix)]
 
-    if n_cores == 'auto' and n_cores_max:
-        cmd += ['-nt', 'AUTO', '--threads-max', '%i' % n_cores_max]
-    elif n_cores == 'auto' and n_cores_max is None:
+    if n_cores == 0:
         cmd += ['-nt', 'AUTO']
     else:
+        print('n cores', n_cores)
         cmd += ['-nt', '%i' % n_cores]
 
+    if n_cores_max is not None and n_cores_max > 0:
+        cmd += ['--threads-max', '%i' % n_cores_max]
+
     if seed:
         cmd += ['-seed', '%i' % seed]
 
@@ -216,13 +218,14 @@ def _build_iqtree_ufbs_command(
             '-m', str(substitution_model),
             '-pre', str(run_prefix)]
 
-    if n_cores == 'auto' and n_cores_max:
-        cmd += ['-nt', 'AUTO', '--threads-max', '%i' % n_cores_max]
-    elif n_cores == 'auto' and n_cores_max is None:
+    if n_cores == 0:
         cmd += ['-nt', 'AUTO']
     else:
         cmd += ['-nt', '%i' % n_cores]
 
+    if n_cores_max is not None and n_cores_max > 0:
+        cmd += ['--threads-max', '%i' % n_cores_max]
+
     if seed:
         cmd += ['-seed', '%i' % seed]
 


=====================================
q2_phylogeny/_raxml.py
=====================================
@@ -14,6 +14,7 @@ from random import randint
 
 from q2_types.feature_data import AlignedDNAFASTAFormat
 from q2_types.tree import NewickFormat
+from qiime2.plugin import get_available_cores
 
 _raxml_versions = {
                    'Standard': '',
@@ -35,6 +36,9 @@ def run_command(cmd, verbose=True):
 
 
 def _set_raxml_version(raxml_version='Standard', n_threads=1):
+    if n_threads == 0:
+        n_threads = get_available_cores()
+
     if n_threads == 1:
         cmd = ['raxmlHPC' + _raxml_versions[raxml_version]]
         return cmd


=====================================
q2_phylogeny/_version.py
=====================================
@@ -23,9 +23,9 @@ def get_keywords():
     # setup.py/versioneer.py will grep for the variable names, so they must
     # each be defined on a line of their own. _version.py will just call
     # get_keywords().
-    git_refnames = " (tag: 2023.9.0, Release-2023.9)"
-    git_full = "3f6beeea0d4c1510daf772f75a05d6fc95a1f37a"
-    git_date = "2023-10-03 22:01:55 +0000"
+    git_refnames = " (tag: 2024.2.0, Release-2024.2)"
+    git_full = "f0ffa35ea1132d9eb7a26bb23510521a020ec463"
+    git_date = "2024-02-16 21:58:36 +0000"
     keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
     return keywords
 


=====================================
q2_phylogeny/plugin_setup.py
=====================================
@@ -7,7 +7,7 @@
 # ----------------------------------------------------------------------------
 
 from qiime2.plugin import (Plugin, Citations, Int, Range, Str, Choices, Bool,
-                           Float, List, TypeMatch, Metadata)
+                           Float, List, TypeMatch, Metadata, Threads)
 from q2_types.tree import Phylogeny, Unrooted, Rooted
 from q2_types.feature_data import FeatureData, AlignedSequence, Sequence
 from q2_types.feature_table import (FeatureTable, Frequency,
@@ -104,7 +104,7 @@ plugin.methods.register_function(
 plugin.methods.register_function(
     function=q2_phylogeny.fasttree,
     inputs={'alignment': FeatureData[AlignedSequence]},
-    parameters={'n_threads': Int % Range(1, None) | Str % Choices(['auto'])},
+    parameters={'n_threads': Threads},
     outputs=[('tree', Phylogeny[Unrooted])],
     input_descriptions={
         'alignment': ('Aligned sequences to be used for phylogenetic '
@@ -132,7 +132,7 @@ plugin.methods.register_function(
     parameters={
             'seed': Int,
             'n_searches': Int % Range(1, None),
-            'n_threads': Int % Range(1, None),
+            'n_threads': Threads,
             'substitution_model': Str % Choices(_RAXML_MODEL_OPT),
             'raxml_version': Str % Choices(_RAXML_VERSION_OPT)},
     outputs=[('tree', Phylogeny[Unrooted])],
@@ -171,7 +171,7 @@ plugin.methods.register_function(
             'seed': Int,
             'rapid_bootstrap_seed': Int,
             'bootstrap_replicates': Int % Range(10, None),
-            'n_threads': Int % Range(1, None),
+            'n_threads': Threads,
             'substitution_model': Str % Choices(_RAXML_MODEL_OPT),
             'raxml_version': Str % Choices(_RAXML_VERSION_OPT)},
     outputs=[('tree', Phylogeny[Unrooted])],
@@ -212,8 +212,8 @@ plugin.methods.register_function(
     inputs={'alignment': FeatureData[AlignedSequence]},
     parameters={
             'seed': Int,
-            'n_cores': Int % Range(1, None) | Str % Choices(['auto']),
-            'n_cores_max': Int % Range(2, None),
+            'n_cores': Threads,
+            'n_cores_max': Threads,
             'n_runs': Int % Range(1, None),
             'substitution_model': Str % Choices(_IQTREE_DNA_MODELS),
             'n_init_pars_trees': Int % Range(1, None),
@@ -297,8 +297,8 @@ plugin.methods.register_function(
     inputs={'alignment': FeatureData[AlignedSequence]},
     parameters={
             'seed': Int,
-            'n_cores': Int % Range(1, None) | Str % Choices(['auto']),
-            'n_cores_max': Int % Range(2, None),
+            'n_cores': Threads,
+            'n_cores_max': Threads,
             'n_runs': Int % Range(1, None),
             'substitution_model': Str % Choices(_IQTREE_DNA_MODELS),
             'n_init_pars_trees': Int % Range(1, None),
@@ -495,7 +495,7 @@ plugin.pipelines.register_function(
         'sequences': FeatureData[Sequence],
     },
     parameters={
-        'n_threads': Int % Range(1, None) | Str % Choices(['auto']),
+        'n_threads': Threads,
         'mask_max_gap_frequency': Float % Range(0, 1, inclusive_end=True),
         'mask_min_conservation': Float % Range(0, 1, inclusive_end=True),
         'parttree': Bool,
@@ -568,7 +568,7 @@ plugin.pipelines.register_function(
         'sequences': FeatureData[Sequence],
     },
     parameters={
-        'n_threads': Int % Range(1, None) | Str % Choices(['auto']),
+        'n_threads': Threads,
         'mask_max_gap_frequency': Float % Range(0, 1, inclusive_end=True),
         'mask_min_conservation': Float % Range(0, 1, inclusive_end=True),
         'seed': Int,
@@ -659,7 +659,7 @@ plugin.pipelines.register_function(
         'sequences': FeatureData[Sequence],
     },
     parameters={
-        'n_threads': Int % Range(1, None) | Str % Choices(['auto']),
+        'n_threads': Threads,
         'mask_max_gap_frequency': Float % Range(0, 1, inclusive_end=True),
         'mask_min_conservation': Float % Range(0, 1, inclusive_end=True),
         'parttree': Bool,


=====================================
q2_phylogeny/tests/test_iqtree.py
=====================================
@@ -103,7 +103,7 @@ class IqtreeTests(TestPluginBase):
         input_sequences = AlignedDNAFASTAFormat(input_fp, mode='r')
 
         with redirected_stdio(stderr=os.devnull):
-            obs = iqtree(input_sequences, n_cores='auto')
+            obs = iqtree(input_sequences, n_cores=0)
         obs_tree = skbio.TreeNode.read(str(obs), convert_underscores=False)
 
         # load the resulting tree and test that it has the right number of
@@ -122,7 +122,7 @@ class IqtreeTests(TestPluginBase):
         input_sequences = AlignedDNAFASTAFormat(input_fp, mode='r')
 
         with redirected_stdio(stderr=os.devnull):
-            obs = iqtree(input_sequences, n_cores='auto', n_cores_max=2)
+            obs = iqtree(input_sequences, n_cores=0, n_cores_max=2)
         obs_tree = skbio.TreeNode.read(str(obs), convert_underscores=False)
 
         # load the resulting tree and test that it has the right number of
@@ -197,7 +197,7 @@ class IqtreeTests(TestPluginBase):
             with redirected_stdio(stderr=os.devnull):
                 obs = _build_iqtree_command(input_sequences,
                                             seed=1723,
-                                            n_cores='auto',
+                                            n_cores=0,
                                             n_cores_max=4,
                                             n_runs=2,
                                             substitution_model='MFP',
@@ -246,7 +246,7 @@ class IqtreeTests(TestPluginBase):
             with redirected_stdio(stderr=os.devnull):
                 obs = _build_iqtree_ufbs_command(input_sequences,
                                                  seed=1723,
-                                                 n_cores='auto',
+                                                 n_cores=0,
                                                  n_cores_max=6,
                                                  n_runs=5,
                                                  bootstrap_replicates=2000,
@@ -373,7 +373,7 @@ class IqtreeTests(TestPluginBase):
         input_fp = self.get_data_path('aligned-dna-sequences-3.fasta')
         input_sequences = AlignedDNAFASTAFormat(input_fp, mode='r')
         with redirected_stdio(stderr=os.devnull):
-            obs = iqtree_ultrafast_bootstrap(input_sequences, n_cores='auto')
+            obs = iqtree_ultrafast_bootstrap(input_sequences, n_cores=0)
         obs_tree = skbio.TreeNode.read(str(obs))
         # load the resulting tree and test that it has the right number of
         # tips and the right tip ids
@@ -390,7 +390,7 @@ class IqtreeTests(TestPluginBase):
         input_fp = self.get_data_path('aligned-dna-sequences-3.fasta')
         input_sequences = AlignedDNAFASTAFormat(input_fp, mode='r')
         with redirected_stdio(stderr=os.devnull):
-            obs = iqtree_ultrafast_bootstrap(input_sequences, n_cores='auto',
+            obs = iqtree_ultrafast_bootstrap(input_sequences, n_cores=0,
                                              n_cores_max=2)
         obs_tree = skbio.TreeNode.read(str(obs))
         # load the resulting tree and test that it has the right number of



View it on GitLab: https://salsa.debian.org/med-team/q2-phylogeny/-/compare/fc1fa7824ce3c6356207fe23887dc467937c6f73...8e0e5957a63f5a2853e25bc7c432499ad6574b03

-- 
View it on GitLab: https://salsa.debian.org/med-team/q2-phylogeny/-/compare/fc1fa7824ce3c6356207fe23887dc467937c6f73...8e0e5957a63f5a2853e25bc7c432499ad6574b03
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/20240218/acba3bb2/attachment-0001.htm>


More information about the debian-med-commit mailing list