*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / pymediainfo / pymediainfo-4.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=( pypy3 python3_{6,7} )
7 PYTHON_REQ_USE="xml(+)"
8
9 inherit distutils-r1
10
11 DESCRIPTION="A wrapper around the mediainfo library"
12 HOMEPAGE="https://github.com/sbraz/pymediainfo"
13 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
14
15 LICENSE="MIT"
16 SLOT="0"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="doc test"
19 RESTRICT="!test? ( test )"
20
21 RDEPEND="
22         dev-python/setuptools[${PYTHON_USEDEP}]
23         media-libs/libmediainfo
24 "
25 BDEPEND="
26         dev-python/setuptools[${PYTHON_USEDEP}]
27         dev-python/setuptools_scm[${PYTHON_USEDEP}]
28         doc? (
29                 dev-python/alabaster[${PYTHON_USEDEP}]
30                 dev-python/sphinx[${PYTHON_USEDEP}]
31         )
32         test? (
33                 ${RDEPEND}
34                 dev-python/pytest[${PYTHON_USEDEP}]
35         )
36 "
37
38 python_compile_all() {
39         if use doc; then
40                 sphinx-build docs docs/_build/html || die
41                 HTML_DOCS=( docs/_build/html/. )
42         fi
43 }
44
45 python_test() {
46         # Skip a test which requires network access
47         pytest -vv tests/test_pymediainfo.py -k "not MediaInfoURLTest" \
48                 || die "tests failed with ${EPYTHON}"
49 }