Merge ~bryce/ubuntu/+source/nose:fix-lp1859880-py3-sphinx into ubuntu/+source/nose:ubuntu/focal-devel

Proposed by Bryce Harrington
Status: Superseded
Proposed branch: ~bryce/ubuntu/+source/nose:fix-lp1859880-py3-sphinx
Merge into: ubuntu/+source/nose:ubuntu/focal-devel
Diff against target: 104 lines (+18/-23)
3 files modified
debian/changelog (+9/-0)
debian/control (+6/-17)
debian/rules (+3/-6)
Reviewer Review Type Date Requested Status
git-ubuntu developers Pending
Review via email: mp+377754@code.launchpad.net

This proposal has been superseded by a proposal from 2020-01-17.

Description of the change

Several packages are blocked in proposed migration due to having nose as a dependency for their testsuites. Nose has been ported to python3, but the issue is that its code docs are being generated using the python2 version of sphinx.

I considered a few different ways to fix this:

1. Disable code docs. Nose is no longer maintained and upstream recommends using nose2 or pytest instead, so providing code docs may not be very important anymore, as developers should probably not use it anymore. However, the module still works well enough and is widely used so this seems too brute force.
2. Carry a debian patch to convert codebase to python3. With Ubuntu moving towards python3-only, there is little need for preserving python2 support. However, such a patch would touch a lot of code files and thus be brittle and require regeneration if debian changes things.
3. Generate docs from the build output rather than the source.
4. Add 2to3 as a dependency, and run it on the codebase prior to calling sphinx.

I experimented with #3 for a while, but didn't find a clean and robust way to do it. I'm not certain it would produce exactly the same results as generation from source, although that might not matter in practice.

Option #4, running 2to3, works cleanly and is minimally invasive. The main trade-off is it adds another dependency for the package, but this seems a fair trade.

A PPA with this package is available from:
  https://launchpad.net/~bryce/+archive/ubuntu/nose-fix-lp1859880-py3-sphinx/+packages

To post a comment you must log in.

Unmerged commits

24f5a96... by Bryce Harrington

changelog

8dd1f12... by Bryce Harrington

update-maintainer

8f64234... by Bryce Harrington

d/control: Use the python3 version of the coverage module

7a0f3db... by Bryce Harrington

d/control, d/rules: Use the python3 version of sphinx

Convert codebase to python3 before generating code docs

nose's root codebase has some py2-isms, which are fixed up during
setup.py's build via setup3lib.py and setuptool's 2to3 mechanisms.
Unfortunately, sphinx doesn't see these changes and tries to build docs
from the original (python2) codebase.

Previously, the python2 version of sphinx was being used to generate the
docs, so this was not a problem. However, when using python3-sphinx, it
errors when it encounters python2 source. Address this by running 2to3
over the codebase before calling sphinx.

665ffe5... by Bryce Harrington

d/rules, d/control: Drop python2 binary package

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index e1949b7..d289d22 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
1nose (1.3.7-4ubuntu1) focal; urgency=medium
2
3 * Drop python2 support (LP: #1859880)
4 - d/control: Switch to py3 versions of coverage and sphinx modules
5 - d/rules: Force 2to3 when generating code docs with sphinx
6 - d/rules, d/control: Drop py2 binary package
7
8 -- Bryce Harrington <bryce@canonical.com> Thu, 16 Jan 2020 20:20:35 +0000
9
1nose (1.3.7-4build1) focal; urgency=medium10nose (1.3.7-4build1) focal; urgency=medium
211
3 * No-change rebuild to generate dependencies on python2.12 * No-change rebuild to generate dependencies on python2.
diff --git a/debian/control b/debian/control
index 752b5c2..c6e7e46 100644
--- a/debian/control
+++ b/debian/control
@@ -1,7 +1,8 @@
1Source: nose1Source: nose
2Section: python2Section: python
3Priority: optional3Priority: optional
4Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5XSBC-Original-Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
5Uploaders:6Uploaders:
6 Torsten Marek <shlomme@debian.org>,7 Torsten Marek <shlomme@debian.org>,
7 Dmitry Shachnev <mitya57@debian.org>,8 Dmitry Shachnev <mitya57@debian.org>,
@@ -12,13 +13,11 @@ Build-Depends:
12 libjs-jquery-hotkeys,13 libjs-jquery-hotkeys,
13 libjs-jquery-isonscreen,14 libjs-jquery-isonscreen,
14 libjs-jquery-tablesorter,15 libjs-jquery-tablesorter,
15 python-all (>= 2.6.6-3~),16 python3-coverage,
16 python-setuptools (>= 0.6a9),17 python3-sphinx (>= 1.0.7+dfsg),
17 python-sphinx (>= 1.0.7+dfsg),
18 python-coverage,
19 python3-all,18 python3-all,
20 python3-setuptools19 python3-setuptools,
21X-Python-Version: >= 2.520 2to3
22X-Python3-Version: >= 3.221X-Python3-Version: >= 3.2
23Standards-Version: 4.1.322Standards-Version: 4.1.3
24Homepage: https://nose.readthedocs.io/en/latest/23Homepage: https://nose.readthedocs.io/en/latest/
@@ -37,16 +36,6 @@ Description: documentation for discovery and running for Python's unittest
37 .36 .
38 This package provides the documentation for nose.37 This package provides the documentation for nose.
3938
40Package: python-nose
41Architecture: all
42Multi-Arch: foreign
43Depends: python-pkg-resources, ${misc:Depends}, ${python:Depends}
44Suggests: python-coverage, python-nose-doc
45Description: test discovery and running of Python's unittest
46 nose provides an alternate test discovery and running process for
47 unittest, one that is intended to mimic the behavior of py.test as
48 much as is reasonably possible without resorting to too much magic
49
50Package: python3-nose39Package: python3-nose
51Architecture: all40Architecture: all
52Multi-Arch: foreign41Multi-Arch: foreign
diff --git a/debian/rules b/debian/rules
index c48a026..6007e02 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,30 +1,27 @@
1#!/usr/bin/make -f1#!/usr/bin/make -f
22
3DESTDIR2 := $(CURDIR)/debian/python-nose
4DESTDIR3 := $(CURDIR)/debian/python3-nose3DESTDIR3 := $(CURDIR)/debian/python3-nose
54
6export PYBUILD_NAME = nose5export PYBUILD_NAME = nose
7export PYBUILD_TEST_ARGS_python2 = {interpreter} setup.py test
8export PYBUILD_TEST_ARGS_python3 = {interpreter} setup.py build_tests && {interpreter} selftest.py -v6export PYBUILD_TEST_ARGS_python3 = {interpreter} setup.py build_tests && {interpreter} selftest.py -v
97
10%:8%:
11 dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild9 dh $@ --with python3,sphinxdoc --buildsystem=pybuild
1210
13override_dh_auto_build:11override_dh_auto_build:
14 dh_auto_build12 dh_auto_build
15 python setup.py build_sphinx13 2to3 -w --no-diffs --nobackups nose
14 python3 setup.py build_sphinx
1615
17override_dh_auto_test:16override_dh_auto_test:
18 dh_auto_test -- --system=custom17 dh_auto_test -- --system=custom
1918
20override_dh_auto_install:19override_dh_auto_install:
21 dh_auto_install20 dh_auto_install
22 sed -i -e 's,#!/usr/bin/python.*,#!/usr/bin/python,' $(DESTDIR2)/usr/bin/nosetests
23 cd $(DESTDIR3)/usr/bin/ && mv nosetests nosetests321 cd $(DESTDIR3)/usr/bin/ && mv nosetests nosetests3
24 rm -f $(DESTDIR3)/usr/bin/nosetests-3.*22 rm -f $(DESTDIR3)/usr/bin/nosetests-3.*
25 sed -i -e 's,#!/usr/bin/python3.*,#!/usr/bin/python3,' $(DESTDIR3)/usr/bin/nosetests323 sed -i -e 's,#!/usr/bin/python3.*,#!/usr/bin/python3,' $(DESTDIR3)/usr/bin/nosetests3
2624
27override_dh_installman:25override_dh_installman:
28 dh_installman -p python-nose nosetests.1
29 dh_installman -p python3-nose nosetests.126 dh_installman -p python3-nose nosetests.1
30 cd $(DESTDIR3)/usr/share/man/man1 && mv nosetests.1 nosetests3.127 cd $(DESTDIR3)/usr/share/man/man1 && mv nosetests.1 nosetests3.1

Subscribers

People subscribed via source and target branches