b8ce29ccc22b3fcda92d51bf9e5cb88c991291d1
[gentoo.git] / dev-python / epsilon / epsilon-0.7.0.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="5"
5 PYTHON_COMPAT=( python2_7 )
6
7 inherit twisted-r1 eutils
8
9 DESCRIPTION="Epsilon is a Python utilities package, most famous for its Time class"
10 HOMEPAGE="https://github.com/twisted/epsilon https://pypi.org/project/Epsilon/"
11 SRC_URI="mirror://pypi/${TWISTED_PN:0:1}/${TWISTED_PN}/${TWISTED_P}.tar.gz"
12
13 KEYWORDS="amd64 ppc ppc64 sparc x86"
14 IUSE="test"
15 RESTRICT="!test? ( test )"
16
17 RDEPEND=">=dev-python/twisted-core-13.2.0[${PYTHON_USEDEP}]
18                 >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]"
19 DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
20                 test? ( dev-python/nose[${PYTHON_USEDEP}] )
21                 ${DEPEND}"
22
23 PATCHES=( "${FILESDIR}/epsilon_plugincache_portagesandbox.patch" )
24
25 # epsilon doesn't install any plugins, so override the default
26 TWISTED_PLUGINS=()
27
28 python_prepare_all() {
29         # Rename to avoid file-collisions
30         mv bin/benchmark bin/epsilon-benchmark
31         sed -i \
32                 -e "s#bin/benchmark#bin/epsilon-benchmark#" \
33                 setup.py || die "sed failed"
34
35         #These test are removed upstream
36         rm -f epsilon/test/test_sslverify.py epsilon/sslverify.py || die
37         #See bug 357157 comment 5 for Ian Delaney's explanation of this fix
38         sed -e 's:month) 2004 9:month) 2004 14:' \
39                 -i epsilon/test/test_extime.py || die
40         # Release tests need DivmodCombinator.
41         rm -f epsilon/test/test_release.py* epsilon/release.py || die
42
43         distutils-r1_python_prepare_all
44 }
45
46 python_install_all() {
47         dodoc NAME.txt NEWS.txt
48
49         distutils-r1_python_install_all
50 }
51
52 #Lets run some tests, having prepped them
53 python_test() {
54         # No testrunner seems stipulated within the source; pytest and nosetests both work
55         nosetests ${PN}/test || die "testsuite failed under ${EPYTHON}"
56 }