[med-svn] [python-dendropy] 06/06: Adapt patches to new upstream version

Andreas Tille tille at debian.org
Wed Jul 29 11:20:42 UTC 2015


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository python-dendropy.

commit 16e3163de36731760086dc0d10465ef08dbbb00e
Author: Andreas Tille <tille at debian.org>
Date:   Wed Jul 29 12:55:27 2015 +0200

    Adapt patches to new upstream version
---
 debian/changelog                                   |   2 +-
 ...where-encoding-for-default-locale-is-None.patch |  11 +-
 ...PAUP-based-tests-unless-path-to-PAUP-is-p.patch | 252 +--------------------
 3 files changed, 7 insertions(+), 258 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index bb23207..77909f6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-python-dendropy (4.0.2-1) unstable; urgency=low
+python-dendropy (4.0.3-1) UNRELEASED; urgency=low
 
   * Initial release (Closes: #790408)
 
diff --git a/debian/patches/0001-Fix-bug-where-encoding-for-default-locale-is-None.patch b/debian/patches/0001-Fix-bug-where-encoding-for-default-locale-is-None.patch
index 309b3ec..ab4ee2c 100644
--- a/debian/patches/0001-Fix-bug-where-encoding-for-default-locale-is-None.patch
+++ b/debian/patches/0001-Fix-bug-where-encoding-for-default-locale-is-None.patch
@@ -7,13 +7,11 @@ Subject: [PATCH] Fix bug where encoding for default locale is None.
  dendropy/utility/textprocessing.py | 3 +++
  1 file changed, 3 insertions(+)
 
-diff --git a/dendropy/utility/textprocessing.py b/dendropy/utility/textprocessing.py
-index 1227e52..872a4e2 100644
 --- a/dendropy/utility/textprocessing.py
 +++ b/dendropy/utility/textprocessing.py
-@@ -32,6 +32,9 @@ import codecs
- 
- ENCODING = locale.getdefaultlocale()[1]
+@@ -35,6 +35,9 @@ ENCODING = locale.getdefaultlocale()[1]
+ if ENCODING == None:
+     ENCODING = 'UTF-8'
  
 +if ENCODING == None:
 +    ENCODING = 'UTF-8'
@@ -21,6 +19,3 @@ index 1227e52..872a4e2 100644
  def bytes_to_text(s):
      """
      Converts a byte string (as read from, e.g., standard input)
--- 
-2.1.4
-
diff --git a/debian/patches/0002-Do-not-run-PAUP-based-tests-unless-path-to-PAUP-is-p.patch b/debian/patches/0002-Do-not-run-PAUP-based-tests-unless-path-to-PAUP-is-p.patch
index ab1f878..be86680 100644
--- a/debian/patches/0002-Do-not-run-PAUP-based-tests-unless-path-to-PAUP-is-p.patch
+++ b/debian/patches/0002-Do-not-run-PAUP-based-tests-unless-path-to-PAUP-is-p.patch
@@ -11,9 +11,9 @@ Subject: [PATCH] Do not run PAUP-based tests unless path to PAUP is provided
 
 --- a/README.rst
 +++ b/README.rst
-@@ -52,6 +52,21 @@ and more.
- Testing
- =======
+@@ -67,6 +67,21 @@ Testing
+     If this variable is not set or set to "NONE", then any tests that rely on
+     PAUP* will NOT be run.
  
 +.. note::
 +
@@ -33,249 +33,3 @@ Subject: [PATCH] Do not run PAUP-based tests unless path to PAUP is provided
  Tests can be run by typing::
  
      $ python -m dendropy.test
---- a/dendropy/interop/paup.py
-+++ b/dendropy/interop/paup.py
-@@ -43,7 +43,7 @@ _LOG = messaging.get_logger(__name__)
- 
- import dendropy
- 
--PAUP_PATH = os.environ.get(metavar.DENDROPY_PAUP_PATH_ENVAR, "paup")
-+PAUP_PATH = os.environ.get(metavar.DENDROPY_PAUP_PATH_ENVAR, "NONE")
- if PAUP_PATH == "NONE":
-     DENDROPY_PAUP_INTEROPERABILITY = False
- else:
---- a/dendropy/test/test_datamodel_split_bitmasks.py
-+++ b/dendropy/test/test_datamodel_split_bitmasks.py
-@@ -141,111 +141,115 @@ class SplitDistributionTestCases(Extende
-                         use_tree_weights=use_weights,
-                         expected_num_trees=num_trees)
- 
--class SplitCountTest(ExtendedTestCase):
--
--    @classmethod
--    def setUpClass(cls):
--        if sys.version_info.major < 3:
--            cls.assertRaisesRegex = cls.assertRaisesRegexp
--
--    def check_split_counting(self,
--            tree_filename,
--            test_as_rooted,
--            parser_rooting_interpretation,
--            test_ignore_tree_weights=False,
--            dp_ignore_tree_weights=False,
--            ):
--        tree_filepath = pathmap.tree_source_path(tree_filename)
--        ps = paup.PaupService()
--        paup_sd = ps.get_split_distribution_from_files(
--                tree_filepaths=[tree_filepath],
--                is_rooted=test_as_rooted,
--                use_tree_weights=not test_ignore_tree_weights,
--                burnin=0,
--                taxa_definition_filepath=tree_filepath
-+if not paup.DENDROPY_PAUP_INTEROPERABILITY:
-+    _LOG.warn("PAUP interoperability not available: skipping split counting tests")
-+else:
-+
-+    class SplitCountTest(ExtendedTestCase):
-+
-+        @classmethod
-+        def setUpClass(cls):
-+            if sys.version_info.major < 3:
-+                cls.assertRaisesRegex = cls.assertRaisesRegexp
-+
-+        def check_split_counting(self,
-+                tree_filename,
-+                test_as_rooted,
-+                parser_rooting_interpretation,
-+                test_ignore_tree_weights=False,
-+                dp_ignore_tree_weights=False,
-+                ):
-+            tree_filepath = pathmap.tree_source_path(tree_filename)
-+            ps = paup.PaupService()
-+            paup_sd = ps.get_split_distribution_from_files(
-+                    tree_filepaths=[tree_filepath],
-+                    is_rooted=test_as_rooted,
-+                    use_tree_weights=not test_ignore_tree_weights,
-+                    burnin=0,
-+                    taxa_definition_filepath=tree_filepath
-+                    )
-+            taxon_namespace = paup_sd.taxon_namespace
-+            dp_sd = dendropy.SplitDistribution(taxon_namespace=taxon_namespace)
-+            dp_sd.ignore_edge_lengths = True
-+            dp_sd.ignore_node_ages = True
-+            dp_sd.ignore_tree_weights = dp_ignore_tree_weights
-+            taxa_mask = taxon_namespace.all_taxa_bitmask()
-+            taxon_namespace.is_mutable = False
-+            trees = dendropy.TreeList.get_from_path(tree_filepath,
-+                    "nexus",
-+                    rooting=parser_rooting_interpretation,
-+                    taxon_namespace=taxon_namespace)
-+            for tree in trees:
-+                self.assertIs(tree.taxon_namespace, taxon_namespace)
-+                self.assertIs(tree.taxon_namespace, dp_sd.taxon_namespace)
-+                dp_sd.count_splits_on_tree(
-+                        tree,
-+                        is_bipartitions_updated=False)
-+            self.assertEqual(dp_sd.total_trees_counted, paup_sd.total_trees_counted)
-+            taxa_mask = taxon_namespace.all_taxa_bitmask()
-+            for split in dp_sd.split_counts:
-+                if not dendropy.Bipartition.is_trivial_bitmask(split, taxa_mask):
-+                    # if split not in paup_sd.split_counts:
-+                    #     print("{}: {}".format(split, split in paup_sd.split_counts))
-+                    #     s2 = taxon_namespace.normalize_bitmask(split)
-+                    #     print("{}: {}".format(s2, s2 in paup_sd.split_counts))
-+                    #     s3 = ~split & taxon_namespace.all_taxa_bitmask()
-+                    #     print("{}: {}".format(s3, s3 in paup_sd.split_counts))
-+                    self.assertIn(split, paup_sd.split_counts, "split not found")
-+                    self.assertEqual(dp_sd.split_counts[split], paup_sd.split_counts[split], "incorrect split frequency")
-+                    del paup_sd.split_counts[split]
-+            remaining_splits = list(paup_sd.split_counts.keys())
-+            for split in remaining_splits:
-+                if dendropy.Bipartition.is_trivial_bitmask(split, taxa_mask):
-+                    del paup_sd.split_counts[split]
-+            self.assertEqual(len(paup_sd.split_counts), 0)
-+
-+        def test_basic_split_count_with_incorrect_rootings_raises_error(self):
-+            assertion_error_regexp1 = re.compile("(incorrect split frequency|split not found)")
-+            test_cases = (
-+                ('pythonidae.reference-trees.nexus', True, "force-unrooted", assertion_error_regexp1),
-+                ('feb032009.trees.nexus', False, "force-rooted", assertion_error_regexp1),
-                 )
--        taxon_namespace = paup_sd.taxon_namespace
--        dp_sd = dendropy.SplitDistribution(taxon_namespace=taxon_namespace)
--        dp_sd.ignore_edge_lengths = True
--        dp_sd.ignore_node_ages = True
--        dp_sd.ignore_tree_weights = dp_ignore_tree_weights
--        taxa_mask = taxon_namespace.all_taxa_bitmask()
--        taxon_namespace.is_mutable = False
--        trees = dendropy.TreeList.get_from_path(tree_filepath,
--                "nexus",
--                rooting=parser_rooting_interpretation,
--                taxon_namespace=taxon_namespace)
--        for tree in trees:
--            self.assertIs(tree.taxon_namespace, taxon_namespace)
--            self.assertIs(tree.taxon_namespace, dp_sd.taxon_namespace)
--            dp_sd.count_splits_on_tree(
--                    tree,
--                    is_bipartitions_updated=False)
--        self.assertEqual(dp_sd.total_trees_counted, paup_sd.total_trees_counted)
--        taxa_mask = taxon_namespace.all_taxa_bitmask()
--        for split in dp_sd.split_counts:
--            if not dendropy.Bipartition.is_trivial_bitmask(split, taxa_mask):
--                # if split not in paup_sd.split_counts:
--                #     print("{}: {}".format(split, split in paup_sd.split_counts))
--                #     s2 = taxon_namespace.normalize_bitmask(split)
--                #     print("{}: {}".format(s2, s2 in paup_sd.split_counts))
--                #     s3 = ~split & taxon_namespace.all_taxa_bitmask()
--                #     print("{}: {}".format(s3, s3 in paup_sd.split_counts))
--                self.assertIn(split, paup_sd.split_counts, "split not found")
--                self.assertEqual(dp_sd.split_counts[split], paup_sd.split_counts[split], "incorrect split frequency")
--                del paup_sd.split_counts[split]
--        remaining_splits = list(paup_sd.split_counts.keys())
--        for split in remaining_splits:
--            if dendropy.Bipartition.is_trivial_bitmask(split, taxa_mask):
--                del paup_sd.split_counts[split]
--        self.assertEqual(len(paup_sd.split_counts), 0)
--
--    def test_basic_split_count_with_incorrect_rootings_raises_error(self):
--        assertion_error_regexp1 = re.compile("(incorrect split frequency|split not found)")
--        test_cases = (
--            ('pythonidae.reference-trees.nexus', True, "force-unrooted", assertion_error_regexp1),
--            ('feb032009.trees.nexus', False, "force-rooted", assertion_error_regexp1),
--            )
--        for test_case, test_as_rooted, parser_rooting_interpretation, assertion_error_regexp in test_cases:
--            with self.assertRaisesRegex(AssertionError, assertion_error_regexp):
--                self.check_split_counting(
--                        test_case,
--                        test_as_rooted=test_as_rooted,
--                        parser_rooting_interpretation=parser_rooting_interpretation)
--
--    def test_basic_split_count_with_incorrect_weight_treatment_raises_error(self):
--        assertion_error_regexp1 = re.compile("incorrect split frequency")
--        test_cases = (
--                ("cetaceans.mb.no-clock.mcmc.weighted-01.trees", False),
--                ("cetaceans.mb.strict-clock.mcmc.weighted-01.trees", True),
--            )
--        for test_case, test_as_rooted in test_cases:
--            with self.assertRaisesRegex(AssertionError, assertion_error_regexp1):
--                self.check_split_counting(
--                        test_case,
--                        test_as_rooted=test_as_rooted,
--                        parser_rooting_interpretation="default-rooted",
--                        test_ignore_tree_weights=False,
--                        dp_ignore_tree_weights=False,
--                        )
--
--    def test_basic_split_counting_under_different_rootings(self):
--        test_cases = (
--            'pythonidae.reference-trees.nexus',
--            'feb032009.trees.nexus',
--            'maj-rule-bug1.trees.nexus',
--            'maj-rule-bug2.trees.nexus',
--            )
--        for is_rooted in (True, False):
--            if is_rooted:
--                rooting = "force-rooted"
--            else:
--                rooting = "force-unrooted"
--            for test_case in test_cases:
--                self.check_split_counting(
--                        test_case,
--                        test_as_rooted=is_rooted,
--                        parser_rooting_interpretation=rooting)
-+            for test_case, test_as_rooted, parser_rooting_interpretation, assertion_error_regexp in test_cases:
-+                with self.assertRaisesRegex(AssertionError, assertion_error_regexp):
-+                    self.check_split_counting(
-+                            test_case,
-+                            test_as_rooted=test_as_rooted,
-+                            parser_rooting_interpretation=parser_rooting_interpretation)
-+
-+        def test_basic_split_count_with_incorrect_weight_treatment_raises_error(self):
-+            assertion_error_regexp1 = re.compile("incorrect split frequency")
-+            test_cases = (
-+                    ("cetaceans.mb.no-clock.mcmc.weighted-01.trees", False),
-+                    ("cetaceans.mb.strict-clock.mcmc.weighted-01.trees", True),
-+                )
-+            for test_case, test_as_rooted in test_cases:
-+                with self.assertRaisesRegex(AssertionError, assertion_error_regexp1):
-+                    self.check_split_counting(
-+                            test_case,
-+                            test_as_rooted=test_as_rooted,
-+                            parser_rooting_interpretation="default-rooted",
-+                            test_ignore_tree_weights=False,
-+                            dp_ignore_tree_weights=False,
-+                            )
-+
-+        def test_basic_split_counting_under_different_rootings(self):
-+            test_cases = (
-+                'pythonidae.reference-trees.nexus',
-+                'feb032009.trees.nexus',
-+                'maj-rule-bug1.trees.nexus',
-+                'maj-rule-bug2.trees.nexus',
-+                )
-+            for is_rooted in (True, False):
-+                if is_rooted:
-+                    rooting = "force-rooted"
-+                else:
-+                    rooting = "force-unrooted"
-+                for test_case in test_cases:
-+                    self.check_split_counting(
-+                            test_case,
-+                            test_as_rooted=is_rooted,
-+                            parser_rooting_interpretation=rooting)
- 
- class CladeMaskTest(unittest.TestCase):
- 
-@@ -374,7 +378,8 @@ class TestTreeSplitSupportCredibilitySco
-                 30.89000000000001 + len(self.trees.taxon_namespace))
- 
- if __name__ == "__main__":
--    if paup.DENDROPY_PAUP_INTEROPERABILITY:
--        unittest.main()
--    else:
--        _LOG.warn("PAUP interoperability not available: skipping split counting tests")
-+    unittest.main()
-+    # if paup.DENDROPY_PAUP_INTEROPERABILITY:
-+    #     unittest.main()
-+    # else:
-+    #     _LOG.warn("PAUP interoperability not available: skipping split counting tests")

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/python-dendropy.git



More information about the debian-med-commit mailing list