sys-process/glances: 3.1.4.1-r1 amd64 stable, bug #720368
[gentoo.git] / media-video / subliminal / subliminal-2.0.5-r3.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 PYTHON_REQ_USE='xml(+)'
8 COMMIT_ID='dd74383d1cba82829ce720f2e439a65d13ffe7ef'
9
10 inherit distutils-r1
11
12 DESCRIPTION="Python library to search and download subtitles"
13 HOMEPAGE="https://github.com/Diaoul/subliminal https://pypi.org/project/subliminal/"
14 SRC_URI="
15         https://github.com/Diaoul/${PN}/archive/${COMMIT_ID}.tar.gz -> ${P}-r2.tar.gz
16         test? ( mirror://sourceforge/matroska/test_files/matroska_test_w1_1.zip )
17 "
18
19 LICENSE="MIT"
20 SLOT="0"
21 KEYWORDS="~amd64 ~x86"
22
23 RDEPEND="
24         >=dev-python/appdirs-1.3[${PYTHON_USEDEP}]
25         >=dev-python/babelfish-0.5.2[${PYTHON_USEDEP}]
26         >=dev-python/beautifulsoup-4.4.0:4[${PYTHON_USEDEP}]
27         >=dev-python/chardet-2.3.0[${PYTHON_USEDEP}]
28         >=dev-python/click-4.0[${PYTHON_USEDEP}]
29         dev-python/decorator[${PYTHON_USEDEP}]
30         >=dev-python/dogpile-cache-0.6.0[${PYTHON_USEDEP}]
31         >=dev-python/enzyme-0.4.1[${PYTHON_USEDEP}]
32         >=dev-python/guessit-2.0.1[${PYTHON_USEDEP}]
33         >=dev-python/pysrt-1.0.1[${PYTHON_USEDEP}]
34         >=dev-python/pytz-2012c[${PYTHON_USEDEP}]
35         >=dev-python/rarfile-2.7[compressed,${PYTHON_USEDEP}]
36         >=dev-python/requests-2.0[${PYTHON_USEDEP}]
37         dev-python/setuptools[${PYTHON_USEDEP}]
38         >=dev-python/six-1.9.0[${PYTHON_USEDEP}]
39         >=dev-python/stevedore-1.0.0[${PYTHON_USEDEP}]
40 "
41 DEPEND="
42         dev-python/setuptools[${PYTHON_USEDEP}]
43         test? (
44                 app-arch/unzip
45                 dev-python/sympy[${PYTHON_USEDEP}]
46                 >=dev-python/vcrpy-1.6.1[${PYTHON_USEDEP}]
47         )
48 "
49
50 # Tests don't work in 2.0.5. Recheck in later versions. See Gentoo bug 630114.
51 RESTRICT=test
52
53 PATCHES=( "${FILESDIR}/${P}-add-missing-comma.patch" )
54
55 S="${WORKDIR}/${PN}-${COMMIT_ID}"
56
57 distutils_enable_tests pytest
58
59 python_prepare_all() {
60         # Disable code checkers as they require unavailable dependencies.
61         sed -i -e 's/--\(pep8\|flakes\)//g' pytest.ini || die
62         sed -i -e "s/'pytest-\(pep8\|flakes\)',//g" setup.py || die
63
64         # Disable unconditional dependency on dev-python/pytest-runner.
65         sed -i -e "s|'pytest-runner'||g" setup.py || die
66
67         if use test; then
68                 mkdir -p tests/data/mkv || die
69                 ln -s "${WORKDIR}"/test*.mkv tests/data/mkv/ || die
70         fi
71
72         distutils-r1_python_prepare_all
73 }