d7bb592f915a7f814ee2b5f8e62e876a8ab21509
[gentoo.git] / dev-python / mediafile / mediafile-0.2.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} )
7 inherit distutils-r1
8
9 DESCRIPTION="Read and write audio files' tags in Python"
10 HOMEPAGE="https://github.com/beetbox/mediafile"
11 SRC_URI="https://github.com/beetbox/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
12
13 LICENSE="MIT"
14 SLOT="0"
15 KEYWORDS="~amd64 ~x86"
16 IUSE="doc test"
17 RESTRICT="!test? ( test )"
18
19 BDEPEND="
20         dev-python/setuptools[${PYTHON_USEDEP}]
21         doc? ( dev-python/sphinx )
22         test? ( dev-python/nose[${PYTHON_USEDEP}] )
23 "
24 DEPEND="
25         >=dev-python/six-1.9.0[${PYTHON_USEDEP}]
26         >=media-libs/mutagen-1.33.0[${PYTHON_USEDEP}]
27 "
28 RDEPEND="${DEPEND}"
29
30 python_compile_all() {
31         if use doc; then
32                 emake -C docs html
33                 rm -r docs/_build/html/_sources || die
34                 HTML_DOCS=( docs/_build/html/. )
35         fi
36 }
37
38 python_test() {
39         nosetests -v || die "Tests failed"
40         if use doc; then
41                 sphinx-build -W -q -b html docs __doctest || die "Doc tests failed"
42         fi
43 }