dev-python/subprocess32: Remove old
[gentoo.git] / dev-python / testfixtures / testfixtures-6.14.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python3_{6,7,8} )
7
8 inherit distutils-r1
9
10 DESCRIPTION="A collection of helpers and mock objects for unit tests and doc tests"
11 HOMEPAGE="https://pypi.org/project/testfixtures/ https://github.com/Simplistix/testfixtures"
12 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
13
14 SLOT="0"
15 LICENSE="MIT"
16 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
17 IUSE="doc test"
18 RESTRICT="!test? ( test )"
19
20 DEPEND="
21         dev-python/setuptools[${PYTHON_USEDEP}]
22         doc? (
23                 dev-python/sphinx[${PYTHON_USEDEP}]
24         )
25         test? (
26                 dev-python/django[${PYTHON_USEDEP}]
27                 dev-python/pytest[${PYTHON_USEDEP}]
28                 dev-python/pytest-django[${PYTHON_USEDEP}]
29                 dev-python/sybil[${PYTHON_USEDEP}]
30                 >=dev-python/twisted-18[${PYTHON_USEDEP}]
31                 dev-python/zope-component[${PYTHON_USEDEP}]
32         )"
33
34 python_prepare_all() {
35         # Prevent un-needed download during build, fix Makefile for doc build
36         sed -e '/'sphinx.ext.intersphinx'/d' -i docs/conf.py || die
37
38         # remove test that tests the stripped zope-component test_components.ComponentsTests
39         rm -f testfixtures/tests/test_components.py docs/components.txt || die
40         distutils-r1_python_prepare_all
41 }
42
43 python_compile_all() {
44         use doc && emake -C docs html
45 }
46
47 python_test() {
48         PYTHONPATH="." \
49         DJANGO_SETTINGS_MODULE=testfixtures.tests.test_django.settings \
50         pytest -vv || die
51 }
52
53 python_install_all() {
54         use doc && HTML_DOCS=( docs/_build/html/. )
55         distutils-r1_python_install_all
56 }