media-video/subliminal: add dev-python/decorator dep, EAPI 7, sort deps
authorNikos Chantziaras <realnc@gmail.com>
Tue, 21 May 2019 21:23:34 +0000 (00:23 +0300)
committerMichał Górny <mgorny@gentoo.org>
Sun, 7 Jul 2019 05:28:14 +0000 (07:28 +0200)
Closes: https://bugs.gentoo.org/686514
Package-Manager: Portage-2.3.68, Repoman-2.3.16
Signed-off-by: Nikos Chantziaras <realnc@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/12073
Signed-off-by: Michał Górny <mgorny@gentoo.org>
media-video/subliminal/subliminal-2.0.5-r3.ebuild [new file with mode: 0644]
media-video/subliminal/subliminal-9999.ebuild

diff --git a/media-video/subliminal/subliminal-2.0.5-r3.ebuild b/media-video/subliminal/subliminal-2.0.5-r3.ebuild
new file mode 100644 (file)
index 0000000..28b3e4c
--- /dev/null
@@ -0,0 +1,80 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python{2_7,3_5,3_6} )
+PYTHON_REQ_USE='xml(+)'
+COMMIT_ID='dd74383d1cba82829ce720f2e439a65d13ffe7ef'
+
+inherit distutils-r1
+
+DESCRIPTION="Python library to search and download subtitles"
+HOMEPAGE="https://github.com/Diaoul/subliminal https://pypi.org/project/subliminal/"
+SRC_URI="
+       https://github.com/Diaoul/${PN}/archive/${COMMIT_ID}.tar.gz -> ${P}-r2.tar.gz
+       test? ( mirror://sourceforge/matroska/test_files/matroska_test_w1_1.zip )
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+RDEPEND="
+       >=dev-python/appdirs-1.3[${PYTHON_USEDEP}]
+       >=dev-python/babelfish-0.5.2[${PYTHON_USEDEP}]
+       >=dev-python/beautifulsoup-4.4.0:4[${PYTHON_USEDEP}]
+       >=dev-python/chardet-2.3.0[${PYTHON_USEDEP}]
+       >=dev-python/click-4.0[${PYTHON_USEDEP}]
+       dev-python/decorator[${PYTHON_USEDEP}]
+       >=dev-python/dogpile-cache-0.6.0[${PYTHON_USEDEP}]
+       >=dev-python/enzyme-0.4.1[${PYTHON_USEDEP}]
+       >=dev-python/guessit-2.0.1[${PYTHON_USEDEP}]
+       >=dev-python/pysrt-1.0.1[${PYTHON_USEDEP}]
+       >=dev-python/pytz-2012c[${PYTHON_USEDEP}]
+       >=dev-python/rarfile-2.7[compressed,${PYTHON_USEDEP}]
+       >=dev-python/requests-2.0[${PYTHON_USEDEP}]
+       dev-python/setuptools[${PYTHON_USEDEP}]
+       >=dev-python/six-1.9.0[${PYTHON_USEDEP}]
+       >=dev-python/stevedore-1.0.0[${PYTHON_USEDEP}]
+       virtual/python-futures[${PYTHON_USEDEP}]
+"
+DEPEND="${RDEPEND}
+       test? (
+               app-arch/unzip
+               $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' python2_7)
+               dev-python/pytest-cov[${PYTHON_USEDEP}]
+               dev-python/pytest-runner[${PYTHON_USEDEP}]
+               dev-python/pytest[${PYTHON_USEDEP}]
+               dev-python/sympy[${PYTHON_USEDEP}]
+               >=dev-python/vcrpy-1.6.1[${PYTHON_USEDEP}]
+       )
+"
+
+# Tests don't work in 2.0.5. Recheck in later versions. See Gentoo bug 630114.
+RESTRICT=test
+
+PATCHES=( "${FILESDIR}/${P}-add-missing-comma.patch" )
+
+S="${WORKDIR}/${PN}-${COMMIT_ID}"
+
+python_prepare_all() {
+       # Disable code checkers as they require unavailable dependencies.
+       sed -i -e 's/--\(pep8\|flakes\)//g' pytest.ini || die
+       sed -i -e "s/'pytest-\(pep8\|flakes\)',//g" setup.py || die
+
+       # Disable unconditional dependency on dev-python/pytest-runner.
+       sed -i -e "s|'pytest-runner'||g" setup.py || die
+
+       if use test; then
+               mkdir -p tests/data/mkv || die
+               ln -s "${WORKDIR}"/test*.mkv tests/data/mkv/ || die
+       fi
+
+       distutils-r1_python_prepare_all
+}
+
+python_test() {
+       esetup.py test
+}
index 95473f3790c287030d5354602063805d68f22bbb..7c83f3864f02eba1150194f245d5f23690f66a10 100644 (file)
@@ -1,7 +1,7 @@
 # Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=7
 
 PYTHON_COMPAT=( python{2_7,3_5,3_6} )
 PYTHON_REQ_USE='xml(+)'
@@ -20,32 +20,33 @@ KEYWORDS=""
 IUSE="test"
 
 RDEPEND="
-       >=dev-python/guessit-2.0.1[${PYTHON_USEDEP}]
+       >=dev-python/appdirs-1.3[${PYTHON_USEDEP}]
        >=dev-python/babelfish-0.5.2[${PYTHON_USEDEP}]
-       >=dev-python/enzyme-0.4.1[${PYTHON_USEDEP}]
        >=dev-python/beautifulsoup-4.4.0:4[${PYTHON_USEDEP}]
-       >=dev-python/requests-2.0[${PYTHON_USEDEP}]
+       >=dev-python/chardet-2.3.0[${PYTHON_USEDEP}]
        >=dev-python/click-4.0[${PYTHON_USEDEP}]
+       dev-python/decorator[${PYTHON_USEDEP}]
        >=dev-python/dogpile-cache-0.6.0[${PYTHON_USEDEP}]
-       >=dev-python/stevedore-1.0.0[${PYTHON_USEDEP}]
-       >=dev-python/chardet-2.3.0[${PYTHON_USEDEP}]
+       >=dev-python/enzyme-0.4.1[${PYTHON_USEDEP}]
+       >=dev-python/guessit-2.0.1[${PYTHON_USEDEP}]
        >=dev-python/pysrt-1.0.1[${PYTHON_USEDEP}]
-       >=dev-python/six-1.9.0[${PYTHON_USEDEP}]
-       >=dev-python/appdirs-1.3[${PYTHON_USEDEP}]
-       >=dev-python/rarfile-2.7[compressed,${PYTHON_USEDEP}]
        >=dev-python/pytz-2012c[${PYTHON_USEDEP}]
+       >=dev-python/rarfile-2.7[compressed,${PYTHON_USEDEP}]
+       >=dev-python/requests-2.0[${PYTHON_USEDEP}]
        dev-python/setuptools[${PYTHON_USEDEP}]
+       >=dev-python/six-1.9.0[${PYTHON_USEDEP}]
+       >=dev-python/stevedore-1.0.0[${PYTHON_USEDEP}]
        virtual/python-futures[${PYTHON_USEDEP}]
 "
 DEPEND="${RDEPEND}
        test? (
                app-arch/unzip
-               >=dev-python/vcrpy-1.6.1[${PYTHON_USEDEP}]
-               dev-python/pytest[${PYTHON_USEDEP}]
+               $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' python2_7)
                dev-python/pytest-cov[${PYTHON_USEDEP}]
                dev-python/pytest-runner[${PYTHON_USEDEP}]
+               dev-python/pytest[${PYTHON_USEDEP}]
                dev-python/sympy[${PYTHON_USEDEP}]
-               $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' python2_7)
+               >=dev-python/vcrpy-1.6.1[${PYTHON_USEDEP}]
        )
 "