[From nobody Thu Sep 24 08:21:10 2026
Received: (at submit) by bugs.debian.org; 23 Sep 2026 21:24:42 +0000
X-Spam-Checker-Version: SpamAssassin 4.0.1-bugs.debian.org_2005_01_02
 (2024-03-25) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-118.1 required=4.0 tests=ALL_TRUSTED,BAYES_00,
 BODY_INCLUDES_PACKAGE,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,
 DKIM_VALID_AU,DKIM_VALID_EF,FOURLA,FROMDEVELOPER,FVGT_m_MULTI_ODD,
 GMAIL,HAS_PACKAGE,MD5_SHA1_SUM,SPF_HELO_NONE,SPF_PASS,
 USER_IN_DKIM_WELCOMELIST autolearn=ham autolearn_force=no
 version=4.0.1-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 185; hammy, 150; neutral, 619; spammy,
 0. spammytokens:
 hammytokens:0.000-+--Hx-spam-relays-external:sk:stravin,
 0.000-+--H*RT:sk:stravin, 0.000-+--Hx-spam-relays-external:311,
 0.000-+--H*RT:311, 0.000-+--H*RT:108
Return-path: &lt;maxy@debian.org&gt;
Received: from stravinsky.debian.org ([2001:41b8:202:deb::311:108]:39648)
 by buxtehude.debian.org with esmtps
 (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
 (Exim 4.96) (envelope-from &lt;maxy@debian.org&gt;) id 1x9USI-0071Rj-0B
 for submit@bugs.debian.org; Wed, 23 Sep 2026 21:24:42 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; 
 s=smtpauto.stravinsky;
 h=X-Debian-User:Content-Type:MIME-Version:Message-ID:
 Subject:To:From:Date:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:
 Content-Description:In-Reply-To:References;
 bh=odoDq+vDujamhlMOI5cBIC4F2SYzJNSq014/hvsyRtw=; b=UnVThAXFc7ped88bpgxmkjXBhW
 b5FdskzmDYiIMLH2050MnhlRs9E+y3kIyc7zuaCP06PrRt3MKvtMIQdTAbMVMnfo+zvdTXct+63Be
 9aK7WPjrIbf5Iz2ACTDZ5rQfUHj8nO7dJvV05VK2HoWo9/XC5gO2OeczZbZNTXaMZaGUix7NR1aXb
 xkIxM7i2U/e4Ee4qUoS5vBK01OyximCXKKEfu7oIXiK1pl/0o6uujx51aMrUJnBnY8EH9puWY2gdN
 ZNbrny5YkVYvSuBirxUS8trHO4zk9q41kBiVBoV96d7dvWxImbrvuC2BYMwVvqCciuhP1hblSaD5H
 7vgbEDPA==;
Received: from authenticated-user by stravinsky.debian.org with esmtpsa
 (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
 (Exim 4.96) (envelope-from &lt;maxy@debian.org&gt;) id 1x9USF-0042gP-0x
 for submit@bugs.debian.org; Wed, 23 Sep 2026 21:24:40 +0000
Date: Wed, 23 Sep 2026 23:24:38 +0200
From: Maximiliano Curia &lt;maxy@debian.org&gt;
To: submit@bugs.debian.org
Subject: emperor: FTBFS against python 3.15rc2
Message-ID: &lt;arRDlkTFf0SFYWIZ@hecuba.gnuservers.com.ar&gt;
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=&quot;TeG8ddE4a2tvmYEF&quot;
Content-Disposition: inline
X-Debian-User: maxy
Delivered-To: submit@bugs.debian.org

--TeG8ddE4a2tvmYEF
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Disposition: inline

Package: src:emperor
Version: 1.0.5+ds-1
User: debian-python@lists.debian.org
Usertags: python3.15
Tags: patch, ftbfs, forky, sid
Severity: important

Hi!

While rebuilding the python related packages against the Python 3.15rc2 version we found that emperor fails to build from source [1].

There are a bunch of issues that need to be tackled:
- Add patch to replace deprecated Sphinx methods removed in Sphinx 9.
- Update python3.12 patch with upstream &quot;replace deprecated assertRaisesRegexp with assertRaisesRegex&quot; (#830). [2]
- Update no_future_dependency patch with upstream patch &quot;trim Python 2 crumbs&quot; (#829). [3]
- Add patch for fallback version when package metadata is not found.
- Add patch to deal with install_nbextension on Notebook 7+.

I've applied these fixes in the sandbox [4] to verify that emperor builds successfully, please consider applying the patches to support the upcoming 3.15 version.

Setting the severity to important for now. Once Python 3.15 is released, it will be added to python3-defaults and this bug will become release critical.

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/4829600/
[2]: https://github.com/biocore/emperor/commit/ba319b96e4072837e2c76bf597b2bc7ff5eb7259
[3]: https://github.com/biocore/emperor/commit/1ba443724d2b6ba26fa694f8b9ad3113e727786a
[4]: https://debusine.debian.net/debian/r-python-python3.15/

-- 
&quot;Can you imagine what I would do if I could do all I can?&quot; -- Sun Tzu
Saludos /\/\ /\ &gt;&lt; `/

--TeG8ddE4a2tvmYEF
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename=emperor_1.0.5+ds-2.diff

diff --git a/debian/changelog b/debian/changelog
index 160d727..8a9aa5c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+emperor (1.0.5+ds-2) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * Replace deprecated Sphinx methods removed in Sphinx 9
+  * Add patch Replace deprecated Sphinx methods removed in Sphinx 9
+  * Update python3.12 patch with the upstream submitted accepted version
+  * Update no_future_dependency patch with the upstream accepted version
+  * Add patch Fallback version when package metadata is not found
+  * Add patch to deal with install_nbextension on Notebook 7+
+
+ -- Maximiliano Curia &lt;maxy@debian.org&gt;  Tue, 22 Sep 2026 23:39:53 +0200
+
 emperor (1.0.5+ds-1) unstable; urgency=medium
 
   * Team upload.
diff --git a/debian/patches/importlib-metadata-fallback.patch b/debian/patches/importlib-metadata-fallback.patch
new file mode 100644
index 0000000..09e3522
--- /dev/null
+++ b/debian/patches/importlib-metadata-fallback.patch
@@ -0,0 +1,21 @@
+Description: Fallback version when package metadata is not found
+Author: Maximiliano Curia &lt;maxy@debian.org&gt;
+Forwarded: no
+Last-Update: 2026-09-22
+
+--- a/emperor/__init__.py
++++ b/emperor/__init__.py
+@@ -6,8 +6,11 @@
+ # The full license is in the file LICENSE.md, distributed with this software.
+ # ----------------------------------------------------------------------------
+ 
+-from importlib.metadata import version
+-__version__ = version('emperor')  # noqa
++from importlib.metadata import PackageNotFoundError, version
++try:
++    __version__ = version('emperor')  # noqa
++except PackageNotFoundError:
++    __version__ = '1.0.5'
+ 
+ from emperor.core import Emperor
+ from emperor._pandas import scatterplot
diff --git a/debian/patches/no_future_dependency.patch b/debian/patches/no_future_dependency.patch
deleted file mode 100644
index faf1c5d..0000000
--- a/debian/patches/no_future_dependency.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Description: Remove extraneous dependency on python3-future
-Bug-Debian: https://bugs.debian.org/1058565
-Author: Alexandre Detiste &lt;alexandre.detiste@gmail.com&gt;
-Last-Update: Fri, 21 Feb 2025 21:53:49 +0100
-
---- a/setup.py
-+++ b/setup.py
-@@ -35,7 +35,7 @@
-     long_description = f.read()
- 
- base = [&quot;numpy &gt;= 1.7&quot;, &quot;scipy &gt;= 0.17.0&quot;, &quot;click&quot;, &quot;pandas&quot;,
--        &quot;scikit-bio &gt;= 0.4.1&quot;, &quot;jinja2 &gt;= 2.9&quot;, &quot;future&quot;]
-+        &quot;scikit-bio &gt;= 0.4.1&quot;, &quot;jinja2 &gt;= 2.9&quot;]
- doc = [&quot;Sphinx&lt;4&quot;, &quot;jinja2 &gt;= 2.9, &lt; 3.1&quot;, &quot;sphinx-bootstrap-theme&quot;,
-        &quot;numpydoc&quot;]
- test = [&quot;pep8&quot;, &quot;flake8&quot;, &quot;nose&quot;]
diff --git a/debian/patches/notebook7_compatibility.patch b/debian/patches/notebook7_compatibility.patch
new file mode 100644
index 0000000..5b0b942
--- /dev/null
+++ b/debian/patches/notebook7_compatibility.patch
@@ -0,0 +1,59 @@
+Description: Handle missing install_nbextension on Notebook 7+ and modern IPython
+Author: Maximiliano Curia &lt;maxy@debian.org&gt;
+Forwarded: no
+Last-Update: 2026-09-23
+
+Index: emperor/emperor/util.py
+===================================================================
+--- emperor.orig/emperor/util.py
++++ emperor/emperor/util.py
+@@ -94,9 +94,15 @@ def nbinstall(overwrite=False, user=True
+ 
+     # Lazy imports so we don't pollute the namespace.
+     try:
+-        from notebook import install_nbextension
++        from notebook.nbextensions import install_nbextension
+     except ImportError:
+-        from IPython.html.nbextensions import install_nbextension
++        try:
++            from notebook import install_nbextension
++        except ImportError:
++            try:
++                from IPython.html.nbextensions import install_nbextension
++            except ImportError:
++                raise ImportError(&quot;install_nbextension is not available&quot;)
+     from IPython import version_info
+ 
+     install_nbextension(
+Index: emperor/tests/test_util.py
+===================================================================
+--- emperor.orig/tests/test_util.py
++++ emperor/tests/test_util.py
+@@ -114,7 +114,8 @@ class TopLevelTests(TestCase):
+ 
+     def tearDown(self):
+         for f in self.files_to_delete:
+-            rmtree(f)
++            if exists(f):
++                rmtree(f)
+ 
+     def test_preprocess_coords_file(self):
+         &quot;&quot;&quot;Check correct processing is applied to the coords&quot;&quot;&quot;
+@@ -264,6 +265,17 @@ class TopLevelTests(TestCase):
+         self.assertEqual(o_clones, 4)
+ 
+     def test_nbinstall(self):
++        try:
++            from notebook.nbextensions import install_nbextension
++        except ImportError:
++            try:
++                from notebook import install_nbextension
++            except ImportError:
++                try:
++                    from IPython.html.nbextensions import install_nbextension
++                except ImportError:
++                    self.skipTest(&quot;install_nbextension is not available&quot;)
++
+         temp_dir = gettempdir()
+         target_path = join(temp_dir, 'share/jupyter/nbextensions/emperor/'
+                            'support_files')
diff --git a/debian/patches/python3.12,patch b/debian/patches/python3.12,patch
deleted file mode 100644
index e664895..0000000
--- a/debian/patches/python3.12,patch
+++ /dev/null
@@ -1,60 +0,0 @@
-Description: Fix test
-Author: Andreas Tille &lt;tille@debian.org&gt;
-Last-Update: Fri, 15 Dec 2023 22:10:49 +0100
-
---- a/tests/test_core.py
-+++ b/tests/test_core.py
-@@ -237,7 +237,7 @@
-         self.ord_res.proportion_explained = \
-             self.ord_res.proportion_explained[:1].copy()
- 
--        with self.assertRaisesRegexp(ValueError, &quot;Ordinations with less than &quot;
-+        with self.assertRaisesRegex(ValueError, &quot;Ordinations with less than &quot;
-                                      &quot;two dimensions are not supported&quot;):
-             Emperor(self.ord_res, self.mf, remote=False)
- 
-@@ -245,7 +245,7 @@
-         mf = self.mf.copy()
-         mf.drop(['PC.354', 'PC.355', 'PC.356', 'PC.481', 'PC.607', 'PC.636'],
-                 inplace=True)
--        with self.assertRaisesRegexp(KeyError, &quot;There are samples not &quot;
-+        with self.assertRaisesRegex(KeyError, &quot;There are samples not &quot;
-                                      &quot;included in the sample mapping file. &quot;
-                                      &quot;Override this error by using the &quot;
-                                      &quot;`ignore_missing_samples` argument. &quot;
-@@ -257,7 +257,7 @@
-     def test_initial_unbalanced(self):
-         mf = self.mf.copy()
-         mf.drop(['PC.354'], inplace=True)
--        with self.assertRaisesRegexp(KeyError, &quot;There are samples not &quot;
-+        with self.assertRaisesRegex(KeyError, &quot;There are samples not &quot;
-                                      &quot;included in the sample mapping file. &quot;
-                                      &quot;Override this error by using the &quot;
-                                      &quot;`ignore_missing_samples` argument. &quot;
-@@ -267,7 +267,7 @@
-         # test feature metadata
-         fmf = self.feature_mf.copy()
-         fmf.drop(['f.PC.636'], inplace=True)
--        with self.assertRaisesRegexp(KeyError, &quot;There are features not &quot;
-+        with self.assertRaisesRegex(KeyError, &quot;There are features not &quot;
-                                      &quot;included in the feature mapping file. &quot;
-                                      &quot;Override this error by using the &quot;
-                                      &quot;`ignore_missing_samples` argument. &quot;
-@@ -323,7 +323,7 @@
-         mf = self.mf.copy()
-         mf.index = mf.index + '.not'
- 
--        with self.assertRaisesRegexp(ValueError, 'None of the sample '
-+        with self.assertRaisesRegex(ValueError, 'None of the sample '
-                                      'identifiers match between the metadata '
-                                      'and the coordinates. Verify that you are'
-                                      ' using metadata and coordinates '
-@@ -333,7 +333,7 @@
-         fmf = self.feature_mf.copy()
-         fmf.index = fmf.index + '.not'
- 
--        with self.assertRaisesRegexp(ValueError, 'None of the feature '
-+        with self.assertRaisesRegex(ValueError, 'None of the feature '
-                                      'identifiers match between the metadata '
-                                      'and the coordinates. Verify that you are'
-                                      ' using metadata and coordinates '
diff --git a/debian/patches/replace_deprecated_assertRaisesRegexp.patch b/debian/patches/replace_deprecated_assertRaisesRegexp.patch
new file mode 100644
index 0000000..5d8fc33
--- /dev/null
+++ b/debian/patches/replace_deprecated_assertRaisesRegexp.patch
@@ -0,0 +1,104 @@
+From: Alexandre Detiste &lt;alexandre.detiste@gmail.com&gt;
+Date: Mon, 12 Jan 2026 18:01:04 +0100
+Subject: replace deprecated assertRaisesRegexp with assertRaisesRegex (#830)
+Origin: https://github.com/biocore/emperor/commit/ba319b96e4072837e2c76bf597b2bc7ff5eb7259
+
+---
+ tests/test_core.py | 58 +++++++++++++++++++++++-----------------------
+ 1 file changed, 29 insertions(+), 29 deletions(-)
+
+--- a/tests/test_core.py
++++ b/tests/test_core.py
+@@ -236,41 +236,41 @@ class TopLevelTests(TestCase):
+         self.ord_res.proportion_explained = \
+             self.ord_res.proportion_explained[:1].copy()
+ 
+-        with self.assertRaisesRegexp(ValueError, &quot;Ordinations with less than &quot;
+-                                     &quot;two dimensions are not supported&quot;):
++        with self.assertRaisesRegex(ValueError, &quot;Ordinations with less than &quot;
++                                    &quot;two dimensions are not supported&quot;):
+             Emperor(self.ord_res, self.mf, remote=False)
+ 
+     def test_initial_unbalanced_more_than_five(self):
+         mf = self.mf.copy()
+         mf.drop(['PC.354', 'PC.355', 'PC.356', 'PC.481', 'PC.607', 'PC.636'],
+                 inplace=True)
+-        with self.assertRaisesRegexp(KeyError, &quot;There are samples not &quot;
+-                                     &quot;included in the sample mapping file. &quot;
+-                                     &quot;Override this error by using the &quot;
+-                                     &quot;`ignore_missing_samples` argument. &quot;
+-                                     &quot;Showing only the first 5 samples out of &quot;
+-                                     &quot;6: PC.354, PC.355, PC.356, PC.481, &quot;
+-                                     &quot;PC.607 ...&quot;):
++        with self.assertRaisesRegex(KeyError, &quot;There are samples not &quot;
++                                    &quot;included in the sample mapping file. &quot;
++                                    &quot;Override this error by using the &quot;
++                                    &quot;`ignore_missing_samples` argument. &quot;
++                                    &quot;Showing only the first 5 samples out of &quot;
++                                    &quot;6: PC.354, PC.355, PC.356, PC.481, &quot;
++                                    &quot;PC.607 ...&quot;):
+             Emperor(self.ord_res, mf, remote=self.url)
+ 
+     def test_initial_unbalanced(self):
+         mf = self.mf.copy()
+         mf.drop(['PC.354'], inplace=True)
+-        with self.assertRaisesRegexp(KeyError, &quot;There are samples not &quot;
+-                                     &quot;included in the sample mapping file. &quot;
+-                                     &quot;Override this error by using the &quot;
+-                                     &quot;`ignore_missing_samples` argument. &quot;
+-                                     &quot;Offending samples: PC.354&quot;):
++        with self.assertRaisesRegex(KeyError, &quot;There are samples not &quot;
++                                    &quot;included in the sample mapping file. &quot;
++                                    &quot;Override this error by using the &quot;
++                                    &quot;`ignore_missing_samples` argument. &quot;
++                                    &quot;Offending samples: PC.354&quot;):
+             Emperor(self.ord_res, mf, remote=self.url)
+ 
+         # test feature metadata
+         fmf = self.feature_mf.copy()
+         fmf.drop(['f.PC.636'], inplace=True)
+-        with self.assertRaisesRegexp(KeyError, &quot;There are features not &quot;
+-                                     &quot;included in the feature mapping file. &quot;
+-                                     &quot;Override this error by using the &quot;
+-                                     &quot;`ignore_missing_samples` argument. &quot;
+-                                     &quot;Offending features: f.PC.636&quot;):
++        with self.assertRaisesRegex(KeyError, &quot;There are features not &quot;
++                                    &quot;included in the feature mapping file. &quot;
++                                    &quot;Override this error by using the &quot;
++                                    &quot;`ignore_missing_samples` argument. &quot;
++                                    &quot;Offending features: f.PC.636&quot;):
+             Emperor(self.biplot, self.mf, fmf, remote=self.url)
+ 
+     def test_initial_unbalanced_ignore(self):
+@@ -322,21 +322,21 @@ class TopLevelTests(TestCase):
+         mf = self.mf.copy()
+         mf.index = mf.index + '.not'
+ 
+-        with self.assertRaisesRegexp(ValueError, 'None of the sample '
+-                                     'identifiers match between the metadata '
+-                                     'and the coordinates. Verify that you are'
+-                                     ' using metadata and coordinates '
+-                                     'corresponding to the same dataset.'):
++        with self.assertRaisesRegex(ValueError, 'None of the sample '
++                                    'identifiers match between the metadata '
++                                    'and the coordinates. Verify that you are'
++                                    ' using metadata and coordinates '
++                                    'corresponding to the same dataset.'):
+             Emperor(self.ord_res, mf, remote=self.url)
+ 
+         fmf = self.feature_mf.copy()
+         fmf.index = fmf.index + '.not'
+ 
+-        with self.assertRaisesRegexp(ValueError, 'None of the feature '
+-                                     'identifiers match between the metadata '
+-                                     'and the coordinates. Verify that you are'
+-                                     ' using metadata and coordinates '
+-                                     'corresponding to the same dataset.'):
++        with self.assertRaisesRegex(ValueError, 'None of the feature '
++                                    'identifiers match between the metadata '
++                                    'and the coordinates. Verify that you are'
++                                    ' using metadata and coordinates '
++                                    'corresponding to the same dataset.'):
+             Emperor(self.biplot, self.mf, fmf, remote=self.url)
+ 
+     def test_get_template(self):
diff --git a/debian/patches/series b/debian/patches/series
index 6e4d29b..f95bda2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,5 +1,8 @@
 do_not_use_custom_numpydoc.patch
 correct_jsdoc_arguments.patch
 EditSectionTitle.patch
-no_future_dependency.patch
-python3.12,patch
+trim_python_2_crumbs.patch
+replace_deprecated_assertRaisesRegexp.patch
+sphinx9.patch
+importlib-metadata-fallback.patch
+notebook7_compatibility.patch
diff --git a/debian/patches/sphinx9.patch b/debian/patches/sphinx9.patch
new file mode 100644
index 0000000..415ac13
--- /dev/null
+++ b/debian/patches/sphinx9.patch
@@ -0,0 +1,23 @@
+Description: Replace deprecated Sphinx methods removed in Sphinx 9 and add emperor to sys.path
+Author: Maximiliano Curia &lt;maxy@debian.org&gt;
+Forwarded: no
+Last-Update: 2026-09-23
+
+--- a/doc/source/conf.py
++++ b/doc/source/conf.py
+@@ -16,6 +16,7 @@
+ import os
+ import glob
+ 
++sys.path.insert(0, os.path.abspath('../..'))
+ import sphinx_bootstrap_theme
+ 
+ # -- Options for autosummary ----------------------------------------------
+@@ -271,5 +272,5 @@
+ # Add the 'copybutton' javascript, to hide/show the prompt in code
+ # examples, originally taken from scikit-learn's doc/conf.py
+ def setup(app):
+-    app.add_javascript('copybutton.js')
+-    app.add_stylesheet('style.css')
++    app.add_js_file('copybutton.js')
++    app.add_css_file('style.css')
diff --git a/debian/patches/trim_python_2_crumbs.patch b/debian/patches/trim_python_2_crumbs.patch
new file mode 100644
index 0000000..45c3b63
--- /dev/null
+++ b/debian/patches/trim_python_2_crumbs.patch
@@ -0,0 +1,146 @@
+From: Alexandre Detiste &lt;alexandre.detiste@gmail.com&gt;
+Date: Mon, 12 Jan 2026 17:07:57 +0100
+Subject: trim Python 2 crumbs (#829)
+Origin: https://github.com/biocore/emperor/commit/1ba443724d2b6ba26fa694f8b9ad3113e727786a
+
+---
+ emperor/_pandas.py                      | 1 -
+ emperor/core.py                         | 1 -
+ emperor/format.py                       | 3 ---
+ emperor/util.py                         | 1 -
+ examples/build.py                       | 1 -
+ setup.py                                | 2 +-
+ tests/test_core.py                      | 1 -
+ tests/test_format.py                    | 1 -
+ tests/test_pandas.py                    | 9 +--------
+ tests/test_qiime_backports/test_util.py | 1 -
+ tests/test_util.py                      | 1 -
+ 11 files changed, 2 insertions(+), 20 deletions(-)
+
+--- a/emperor/_pandas.py
++++ b/emperor/_pandas.py
+@@ -5,7 +5,6 @@
+ #
+ # The full license is in the file LICENSE.md, distributed with this software.
+ # ----------------------------------------------------------------------------
+-from __future__ import division
+ 
+ import numpy as np
+ import pandas as pd
+--- a/emperor/core.py
++++ b/emperor/core.py
+@@ -5,7 +5,6 @@
+ #
+ # The full license is in the file LICENSE.md, distributed with this software.
+ # ----------------------------------------------------------------------------
+-from __future__ import division
+ 
+ from copy import deepcopy
+ from os.path import join
+--- a/emperor/format.py
++++ b/emperor/format.py
+@@ -6,9 +6,6 @@
+ # The full license is in the file COPYING.txt, distributed with this software.
+ # ----------------------------------------------------------------------------
+ 
+-from __future__ import division
+-
+-
+ from sys import argv
+ from os.path import abspath
+ from datetime import datetime
+--- a/emperor/util.py
++++ b/emperor/util.py
+@@ -5,7 +5,6 @@
+ #
+ # The full license is in the file LICENSE.md, distributed with this software.
+ # ----------------------------------------------------------------------------
+-from __future__ import division
+ 
+ import pandas as pd
+ import numpy as np
+--- a/examples/build.py
++++ b/examples/build.py
+@@ -9,7 +9,6 @@ to generate a plot with 111 samples do:
+ Note that you will need jinja2 installed, and to execute the program from
+ within the examples folder.
+ &quot;&quot;&quot;
+-from __future__ import division
+ 
+ from random import sample, choice
+ from sys import argv
+--- a/setup.py
++++ b/setup.py
+@@ -35,7 +35,7 @@ with open('README.md') as f:
+     long_description = f.read()
+ 
+ base = [&quot;numpy &gt;= 1.7&quot;, &quot;scipy &gt;= 0.17.0&quot;, &quot;click&quot;, &quot;pandas&quot;,
+-        &quot;scikit-bio &gt;= 0.4.1&quot;, &quot;jinja2 &gt;= 2.9&quot;, &quot;future&quot;]
++        &quot;scikit-bio &gt;= 0.4.1&quot;, &quot;jinja2 &gt;= 2.9&quot;]
+ doc = [&quot;Sphinx&lt;4&quot;, &quot;jinja2 &gt;= 2.9, &lt; 3.1&quot;, &quot;sphinx-bootstrap-theme&quot;,
+        &quot;numpydoc&quot;]
+ test = [&quot;pep8&quot;, &quot;flake8&quot;, &quot;nose&quot;]
+--- a/tests/test_core.py
++++ b/tests/test_core.py
+@@ -5,7 +5,6 @@
+ #
+ # The full license is in the file LICENSE.md, distributed with this software.
+ # ----------------------------------------------------------------------------
+-from __future__ import division
+ 
+ from unittest import TestCase, main
+ from copy import deepcopy
+--- a/tests/test_format.py
++++ b/tests/test_format.py
+@@ -5,7 +5,6 @@
+ #
+ # The full license is in the file LICENSE.md, distributed with this software.
+ # ----------------------------------------------------------------------------
+-from __future__ import division
+ 
+ from emperor.format import format_emperor_autograph
+ from unittest import TestCase, main
+--- a/tests/test_pandas.py
++++ b/tests/test_pandas.py
+@@ -5,8 +5,8 @@
+ #
+ # The full license is in the file LICENSE.md, distributed with this software.
+ # ----------------------------------------------------------------------------
+-from __future__ import division
+ 
++from io import StringIO
+ from unittest import TestCase, main
+ 
+ import pandas as pd
+@@ -21,13 +21,6 @@ try:
+ except Exception:
+     import _test_core_strings as tcs
+ 
+-# from http://stackoverflow.com/a/22605281/379593
+-import sys
+-if sys.version_info[0] &lt; 3:
+-    from StringIO import StringIO
+-else:
+-    from io import StringIO
+-
+ 
+ class TopLevelTests(TestCase):
+     def setUp(self):
+--- a/tests/test_qiime_backports/test_util.py
++++ b/tests/test_qiime_backports/test_util.py
+@@ -1,5 +1,4 @@
+ #!/usr/bin/env python
+-from __future__ import division
+ 
+ __author__ = &quot;Greg Caporaso&quot;
+ __copyright__ = &quot;Copyright 2011, The QIIME Project&quot;
+--- a/tests/test_util.py
++++ b/tests/test_util.py
+@@ -5,7 +5,6 @@
+ #
+ # The full license is in the file LICENSE.md, distributed with this software.
+ # ----------------------------------------------------------------------------
+-from __future__ import division
+ 
+ from unittest import TestCase, main
+ from os.path import exists, join
diff --git a/debian/rules b/debian/rules
index d9714da..e02aaa3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,19 +3,14 @@
 export DH_VERBOSE = 1
 
 export PYBUILD_NAME=emperor
-
-export PYBUILD_AFTER_BUILD=python{version} setup.py develop --install-dir {build_dir}; \
-	export PYTHONPATH={build_dir}:$(PYTHONPATH); \
-	$(MAKE) -C doc html; \
-	cp -rv {dir}/tests/test_data {build_dir}/tests
-
-export PYBUILD_BEFORE_INSTALL=rm -rvf {build_dir}/emperor.egg* \
-	{build_dir}/site.py {build_dir}/easy-install.pth \
-	{build_dir}/f* {build_dir}/*.py {build_dir}/numpy-config
+export PYBUILD_BEFORE_TEST=cp -rv {dir}/tests/test_data {build_dir}/tests
 
 %:
 	dh $@ --with sphinxdoc --buildsystem=pybuild
 
+execute_after_dh_auto_build-indep:
+	PYTHONPATH=$(CURDIR) $(MAKE) -C doc html
+
 execute_after_dh_installdocs:
 	p=&quot;debian/python3-emperor-doc/usr/share/doc/python3-emperor/jsdoc&quot; ; \
 	if [ -d &quot;$$p&quot; ]; then \
@@ -34,7 +29,7 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 		cd tests/javascript_tests/qunit/ &amp;&amp; ln -s /usr/share/javascript/qunit/qunit.css qunit-min.css \
 		                                 &amp;&amp; ln -s /usr/share/javascript/qunit/qunit.min.js qunit-min.js ; \
 	fi
-	PYTHONPATH=.pybuild/`find .pybuild -name cpython3*_emperor -type d|head -n 1`/build pytest-3
+	dh_auto_test
 endif
 
 execute_after_dh_auto_clean:

--TeG8ddE4a2tvmYEF--
]