Gentoo Archives: gentoo-commits

From: Patrice Clement <monsieurp@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/nose/files/, dev-python/nose/
Date: Tue, 11 Oct 2016 16:36:36
Message-Id: 1476203785.9b2f40d3381f063e3e5ac272898791501d0ca889.monsieurp@gentoo
1 commit: 9b2f40d3381f063e3e5ac272898791501d0ca889
2 Author: Mathy Vanvoorden <mathy <AT> vanvoorden <DOT> be>
3 AuthorDate: Tue Oct 11 14:22:10 2016 +0000
4 Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
5 CommitDate: Tue Oct 11 16:36:25 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9b2f40d3
7
8 dev-python/nose: fixed issue with testing with coverage 4.1.
9
10 I found a patch in an upstream PR but couldn't include the original as it was
11 against master, adapted it to v1.3.7.
12
13 Gentoo-Bug: https://bugs.gentoo.org/593724
14
15 Package-Manager: portage-2.3.0
16 Closes: https://github.com/gentoo/gentoo/pull/2536
17
18 Signed-off-by: Patrice Clement <monsieurp <AT> gentoo.org>
19
20 .../files/nose-1.3.7-coverage-4.1-support.patch | 20 +++++
21 dev-python/nose/nose-1.3.7-r2.ebuild | 94 ++++++++++++++++++++++
22 2 files changed, 114 insertions(+)
23
24 diff --git a/dev-python/nose/files/nose-1.3.7-coverage-4.1-support.patch b/dev-python/nose/files/nose-1.3.7-coverage-4.1-support.patch
25 new file mode 100644
26 index 00000000..8757787
27 --- /dev/null
28 +++ b/dev-python/nose/files/nose-1.3.7-coverage-4.1-support.patch
29 @@ -0,0 +1,20 @@
30 +--- a/nose/plugins/cover.py 2016-10-11 15:51:26.990868010 +0200
31 ++++ b/nose/plugins/cover.py 2016-10-11 15:52:28.261102027 +0200
32 +@@ -187,7 +187,7 @@
33 + for name, module in sys.modules.items()
34 + if self.wantModuleCoverage(name, module)]
35 + log.debug("Coverage report will cover modules: %s", modules)
36 +- self.coverInstance.report(modules, file=stream)
37 ++ self.coverInstance.report(modules, file=stream, show_missing=True)
38 +
39 + import coverage
40 + if self.coverHtmlDir:
41 +@@ -207,7 +207,7 @@
42 + # make sure we have minimum required coverage
43 + if self.coverMinPercentage:
44 + f = StringIO.StringIO()
45 +- self.coverInstance.report(modules, file=f)
46 ++ self.coverInstance.report(modules, file=f, show_missing=True)
47 +
48 + multiPackageRe = (r'-------\s\w+\s+\d+\s+\d+(?:\s+\d+\s+\d+)?'
49 + r'\s+(\d+)%\s+\d*\s{0,1}$')
50
51 diff --git a/dev-python/nose/nose-1.3.7-r2.ebuild b/dev-python/nose/nose-1.3.7-r2.ebuild
52 new file mode 100644
53 index 00000000..9af31fc
54 --- /dev/null
55 +++ b/dev-python/nose/nose-1.3.7-r2.ebuild
56 @@ -0,0 +1,94 @@
57 +# Copyright 1999-2016 Gentoo Foundation
58 +# Distributed under the terms of the GNU General Public License v2
59 +# $Id$
60 +
61 +EAPI=6
62 +
63 +PYTHON_COMPAT=( python2_7 python3_{3,4,5} pypy pypy3 )
64 +PYTHON_REQ_USE="threads(+)"
65 +
66 +inherit distutils-r1
67 +
68 +DESCRIPTION="Unittest extension with automatic test suite discovery and easy test authoring"
69 +HOMEPAGE="
70 + https://pypi.python.org/pypi/nose
71 + http://readthedocs.org/docs/nose/
72 + https://bitbucket.org/jpellerin/nose"
73 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
74 +
75 +LICENSE="LGPL-2.1"
76 +SLOT="0"
77 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
78 +IUSE="doc examples test"
79 +
80 +REQUIRED_USE="
81 + doc? ( || ( $(python_gen_useflags 'python2*') ) )"
82 +
83 +RDEPEND="
84 + dev-python/coverage[${PYTHON_USEDEP}]
85 + dev-python/setuptools[${PYTHON_USEDEP}]"
86 +DEPEND="${RDEPEND}
87 + doc? ( >=dev-python/sphinx-0.6[${PYTHON_USEDEP}] )
88 + test? ( $(python_gen_cond_dep 'dev-python/twisted-core[${PYTHON_USEDEP}]' python2_7) )"
89 +
90 +PATCHES=(
91 + "${FILESDIR}"/${P}-python-3.5-backport.patch
92 +
93 + # Patch against master found in an upstream PR, backported:
94 + # https://github.com/nose-devs/nose/pull/1004
95 + "${FILESDIR}"/${P}-coverage-4.1-support.patch
96 +)
97 +
98 +pkg_setup() {
99 + use doc && DISTUTILS_ALL_SUBPHASE_IMPLS=( 'python2*' )
100 +}
101 +
102 +python_prepare_all() {
103 + # Tests need to be converted, and they don't respect BUILD_DIR.
104 + use test && DISTUTILS_IN_SOURCE_BUILD=1
105 +
106 + # Disable tests requiring network connection.
107 + sed \
108 + -e "s/test_resolve/_&/g" \
109 + -e "s/test_raises_bad_return/_&/g" \
110 + -e "s/test_raises_twisted_error/_&/g" \
111 + -i unit_tests/test_twisted.py || die "sed failed"
112 + # Disable versioning of nosetests script to avoid collision with
113 + # versioning performed by the eclass.
114 + sed -e "/'nosetests%s = nose:run_exit' % py_vers_tag,/d" \
115 + -i setup.py || die "sed2 failed"
116 +
117 + # Prevent un-needed d'loading during doc build
118 + sed -e "s/, 'sphinx.ext.intersphinx'//" -i doc/conf.py || die
119 +
120 + distutils-r1_python_prepare_all
121 +}
122 +
123 +python_compile() {
124 + local add_targets=()
125 +
126 + if use test; then
127 + add_targets+=( egg_info )
128 + python_is_python3 && add_targets+=( build_tests )
129 + fi
130 +
131 + distutils-r1_python_compile ${add_targets[@]}
132 +}
133 +
134 +python_compile_all() {
135 + use doc && emake -C doc html
136 +}
137 +
138 +python_test() {
139 + "${PYTHON}" selftest.py -v || die "Tests fail with ${EPYTHON}"
140 +}
141 +
142 +python_install() {
143 + distutils-r1_python_install --install-data "${EPREFIX}/usr/share"
144 +}
145 +
146 +python_install_all() {
147 + use examples && dodoc -r examples
148 + use doc && HTML_DOCS=( doc/.build/html/. )
149 + distutils-r1_python_install_all
150 +}