Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/mock/
Date: Wed, 13 Nov 2019 10:42:42
Message-Id: 1573641754.2f15c7670fca3d71a18296bd137b538152318592.mgorny@gentoo
1 commit: 2f15c7670fca3d71a18296bd137b538152318592
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Nov 13 09:19:33 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 13 10:42:34 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f15c767
7
8 dev-python/mock: Fix tests
9
10 Switch to GitHub to get tests. Remove absurd test deps. Run tests
11 via unittest to avoid compatibility problems with installed mock.
12
13 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
14
15 dev-python/mock/Manifest | 2 +-
16 dev-python/mock/mock-3.0.5-r1.ebuild | 48 ++++++++++++++++++++++++++++++++++++
17 dev-python/mock/mock-3.0.5.ebuild | 40 ------------------------------
18 3 files changed, 49 insertions(+), 41 deletions(-)
19
20 diff --git a/dev-python/mock/Manifest b/dev-python/mock/Manifest
21 index ded8619cac2..d8ae973f1c4 100644
22 --- a/dev-python/mock/Manifest
23 +++ b/dev-python/mock/Manifest
24 @@ -1,4 +1,4 @@
25 DIST mock-1.0.1.tar.gz 818644 BLAKE2B 7bfe02c413c2f98a2d98ca9cc40ca8831d65b3a5095d95625e0844e764c3510b771dc9e36086dd44f518659cdf7f1d105c02bdb51c5ffe00953c5eb3b0e05106 SHA512 4f6f4ebc34843e16b15d866e415ad9992e79bd266a63a22fee31b773ba77615e3406bc8890ceed92c0ee296380d68c46299c4c4448a3526f9cb96b258d32cf58
26 DIST mock-1.3.0.tar.gz 70908 BLAKE2B 4df669c5d54fc835c70d6190362d4dea9cc0d2e7ca47f6ef5a394bc80cac10898b611146f28da93e84c4b26c23f25708be3c8fc6b61062dae099396e351861d8 SHA512 10cbb78b89f2e82abfcadc035a526182f83b59df4775cd85acfdbeb4505791c63b7a3761e6126a08d9aedbd07ead8632ac2a728dc07a362f4aaeea694bdecaf9
27 DIST mock-2.0.0.tar.gz 73684 BLAKE2B 970bebe72b6969b58acdc2856b53054f992d01f9f3ca5f91b73073d0a1c9ec89a5c94fd66eab85b258f23f33326825ff6598bb2ba8e07eded1e6540a26ac5fa3 SHA512 a08007651b749d2843b94f5045d74c122958888290aea21930455538a854e6b04c07115e21d82edde996154bf597d7a8784a2f4213cbabc49a98dec22dd92238
28 -DIST mock-3.0.5.tar.gz 28126 BLAKE2B 8006beac0b0f6b120298c223bfea159da46abf594cbda3636bc4c04f9effaddc503e0ccc3804c2c070b74d4f1e751fee5bfa839a7591bac855b8aa00563cec7f SHA512 536ab1f0f1448373e9d75e43c6fdb0434adacf0d2cf6eecfe7e590b096c7314914d8e5c20211f196abc59ecb88eb0bf902ae01e7b06d6892e7c0be9d4e35a049
29 +DIST mock-3.0.5.gh.tar.gz 67887 BLAKE2B b9c49b3627275889d73aff9ea9c7925093f9cafb304448b2f06eda2fff26152a031aafb4844537e4d58bc112709e59a44e08d32602776386a30d039743def29c SHA512 9ab4f0c794f5701ba1367d982cf79a5662d4233753d12ed9c88ae20282db1f44be73f84c4d9f6d03ff64926b8c1b6d0c9a79b2a4724a3eb36c247ffd4ab03e2d
30
31 diff --git a/dev-python/mock/mock-3.0.5-r1.ebuild b/dev-python/mock/mock-3.0.5-r1.ebuild
32 new file mode 100644
33 index 00000000000..657e0a3c7cd
34 --- /dev/null
35 +++ b/dev-python/mock/mock-3.0.5-r1.ebuild
36 @@ -0,0 +1,48 @@
37 +# Copyright 1999-2019 Gentoo Authors
38 +# Distributed under the terms of the GNU General Public License v2
39 +
40 +EAPI=6
41 +
42 +PYTHON_COMPAT=( python2_7 python3_{5,6,7} pypy pypy3 )
43 +
44 +inherit distutils-r1
45 +
46 +DESCRIPTION="Rolling backport of unittest.mock for all Pythons"
47 +HOMEPAGE="https://github.com/testing-cabal/mock"
48 +SRC_URI="https://github.com/testing-cabal/mock/archive/${PV}.tar.gz -> ${P}.gh.tar.gz"
49 +
50 +LICENSE="BSD"
51 +SLOT="0"
52 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
53 +
54 +RDEPEND="
55 + >=virtual/python-funcsigs-1[${PYTHON_USEDEP}]
56 + >=dev-python/six-1.9[${PYTHON_USEDEP}]"
57 +DEPEND="${RDEPEND}
58 + >=dev-python/setuptools-17.1[${PYTHON_USEDEP}]"
59 +
60 +python_test() {
61 + # Upstream supports running tests only in their dream pristine
62 + # environment. pytest doesn't work at all if mock is already
63 + # installed. We can use plain unittest but we have to reinvent
64 + # test filtering.
65 + cp -r mock/tests "${BUILD_DIR}"/lib/mock/ || die
66 + cd "${BUILD_DIR}"/lib || die
67 + if ! python_is_python3; then
68 + rm mock/tests/*py3* || die
69 + fi
70 +
71 + # https://github.com/testing-cabal/mock/commit/d6b42149bb87cf38729eef8a100c473f602ef7fa
72 + if [[ ${EPYTHON} == pypy* ]]; then
73 + sed -i -e 's:def test_copy:def _test_copy:' \
74 + mock/tests/testmock.py || die
75 + fi
76 +
77 + "${EPYTHON}" -m unittest discover -v || die "Tests failed with ${EPYTHON}"
78 +}
79 +
80 +python_install_all() {
81 + local DOCS=( CHANGELOG.rst README.rst )
82 +
83 + distutils-r1_python_install_all
84 +}
85
86 diff --git a/dev-python/mock/mock-3.0.5.ebuild b/dev-python/mock/mock-3.0.5.ebuild
87 deleted file mode 100644
88 index fd2c6df9189..00000000000
89 --- a/dev-python/mock/mock-3.0.5.ebuild
90 +++ /dev/null
91 @@ -1,40 +0,0 @@
92 -# Copyright 1999-2019 Gentoo Authors
93 -# Distributed under the terms of the GNU General Public License v2
94 -
95 -EAPI=6
96 -
97 -PYTHON_COMPAT=( python2_7 python3_{5,6,7} pypy pypy3 )
98 -
99 -inherit distutils-r1
100 -
101 -DESCRIPTION="Rolling backport of unittest.mock for all Pythons"
102 -HOMEPAGE="https://github.com/testing-cabal/mock"
103 -SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
104 -
105 -LICENSE="BSD"
106 -SLOT="0"
107 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
108 -IUSE="test"
109 -
110 -RDEPEND="
111 - >=virtual/python-funcsigs-1[${PYTHON_USEDEP}]
112 - >=dev-python/six-1.9[${PYTHON_USEDEP}]"
113 -DEPEND="${RDEPEND}
114 - >=dev-python/setuptools-17.1[${PYTHON_USEDEP}]
115 - test? (
116 - dev-python/nose[${PYTHON_USEDEP}]
117 - dev-python/pytest-cov[${PYTHON_USEDEP}]
118 - >=dev-python/unittest2-1.1.0[${PYTHON_USEDEP}]
119 - )"
120 -
121 -RESTRICT="!test? ( test )"
122 -
123 -python_test() {
124 - nosetests --verbose || die "tests fail under ${EPYTHON}"
125 -}
126 -
127 -python_install_all() {
128 - local DOCS=( CHANGELOG.rst README.rst )
129 -
130 - distutils-r1_python_install_all
131 -}