From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 56678138350 for ; Tue, 21 Jan 2020 14:32:10 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 84F7BE088B; Tue, 21 Jan 2020 14:32:09 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 46C94E088B for ; Tue, 21 Jan 2020 14:32:09 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3C96334E36E for ; Tue, 21 Jan 2020 14:32:07 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BD1E535 for ; Tue, 21 Jan 2020 14:32:05 +0000 (UTC) From: "Andrew Ammerlaan" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andrew Ammerlaan" Message-ID: <1579617087.841e01143bd4d946253af5ae105ec514c8f8fd1b.andrewammerlaan@gentoo> Subject: [gentoo-commits] repo/proj/guru:dev commit in: dev-python/python-mpv/files/, dev-python/python-mpv/ X-VCS-Repository: repo/proj/guru X-VCS-Files: dev-python/python-mpv/Manifest dev-python/python-mpv/files/python-mpv-0.4.5-skip-OSERROR-test.patch dev-python/python-mpv/metadata.xml dev-python/python-mpv/python-mpv-0.4.5.ebuild X-VCS-Directories: dev-python/python-mpv/ dev-python/python-mpv/files/ X-VCS-Committer: andrewammerlaan X-VCS-Committer-Name: Andrew Ammerlaan X-VCS-Revision: 841e01143bd4d946253af5ae105ec514c8f8fd1b X-VCS-Branch: dev Date: Tue, 21 Jan 2020 14:32:05 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 81d0771d-048a-461c-8b7b-30096d15e757 X-Archives-Hash: 1de9968c88c9fae9d3ecd3c8ec8aa453 commit: 841e01143bd4d946253af5ae105ec514c8f8fd1b Author: Andrew Ammerlaan riseup net> AuthorDate: Tue Jan 21 14:31:27 2020 +0000 Commit: Andrew Ammerlaan riseup net> CommitDate: Tue Jan 21 14:31:27 2020 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=841e0114 dev-python/python-mpv: Python interface to the mpv media player Package-Manager: Portage-2.3.84, Repoman-2.3.20 Signed-off-by: Andrew Ammerlaan riseup.net> dev-python/python-mpv/Manifest | 1 + .../files/python-mpv-0.4.5-skip-OSERROR-test.patch | 215 +++++++++++++++++++++ dev-python/python-mpv/metadata.xml | 13 ++ dev-python/python-mpv/python-mpv-0.4.5.ebuild | 28 +++ 4 files changed, 257 insertions(+) diff --git a/dev-python/python-mpv/Manifest b/dev-python/python-mpv/Manifest new file mode 100644 index 0000000..40f67c8 --- /dev/null +++ b/dev-python/python-mpv/Manifest @@ -0,0 +1 @@ +DIST python-mpv-0.4.5.tar.gz 199207 BLAKE2B 4a7bc9662de05dda03ef673bcb63c72626f331e5d3a480eac5dc0b428d76d4bff389b372463612b9f76af748ce39085d0aab12aafbbb7df63d14d03712724046 SHA512 c502e60ffedea18d91e268033da6e4f988a7f48bf677ac3c5c63f849d43360b8e6daccf1b7032c2e61bf4b9a3f08f8dc0fb4904c39499be70d7500d3b4227539 diff --git a/dev-python/python-mpv/files/python-mpv-0.4.5-skip-OSERROR-test.patch b/dev-python/python-mpv/files/python-mpv-0.4.5-skip-OSERROR-test.patch new file mode 100644 index 0000000..b45be31 --- /dev/null +++ b/dev-python/python-mpv/files/python-mpv-0.4.5-skip-OSERROR-test.patch @@ -0,0 +1,215 @@ +diff --git a/mpv-test.py b/mpv-test.py +index 175555b..d1c5f2d 100755 +--- a/mpv-test.py ++++ b/mpv-test.py +@@ -243,56 +243,56 @@ class ObservePropertyTest(MpvTestCase): + m.terminate() # needed for synchronization of event thread + handler.assert_has_calls([mock.call('vid', 'auto')]) + +- @devnull_libmpv() +- def test_property_observer_decorator(self): +- handler = mock.Mock() +- +- m = self.m +- m.play(TESTVID) +- +- m.loop = 'inf' +- m.mute = True +- +- @m.property_observer('mute') +- @m.property_observer('loop') +- def foo(*args, **kwargs): +- handler(*args, **kwargs) +- +- m.mute = False +- m.loop = False +- self.assertEqual(m.mute, False) +- self.assertEqual(m.loop, False) +- +- # Wait for tick. AFAICT property events are only generated at regular +- # intervals, and if we change a property too fast we don't get any +- # events. This is a limitation of the upstream API. +- time.sleep(0.1) +- # Another API limitation is that the order of property change events on +- # different properties does not necessarily exactly match the order in +- # which these properties were previously accessed. Thus, any_order. +- handler.assert_has_calls([ +- mock.call('mute', False), +- mock.call('loop', False)], +- any_order=True) +- handler.reset_mock() +- +- m.mute = True +- m.loop = 'inf' +- self.assertEqual(m.mute, True) +- self.assertEqual(m.loop, True) +- +- time.sleep(0.05) +- foo.unobserve_mpv_properties() +- +- m.mute = False +- m.loop = False +- m.mute = True +- m.loop = 'inf' +- m.terminate() # needed for synchronization of event thread +- handler.assert_has_calls([ +- mock.call('mute', True), +- mock.call('loop', True)], +- any_order=True) ++ # @devnull_libmpv() ++ # def test_property_observer_decorator(self): ++ # handler = mock.Mock() ++ ++ # m = self.m ++ # m.play(TESTVID) ++ ++ # m.loop = 'inf' ++ # m.mute = True ++ ++ # @m.property_observer('mute') ++ # @m.property_observer('loop') ++ # def foo(*args, **kwargs): ++ # handler(*args, **kwargs) ++ ++ # m.mute = False ++ # m.loop = False ++ # self.assertEqual(m.mute, False) ++ # self.assertEqual(m.loop, False) ++ ++ # # Wait for tick. AFAICT property events are only generated at regular ++ # # intervals, and if we change a property too fast we don't get any ++ # # events. This is a limitation of the upstream API. ++ # time.sleep(0.1) ++ # # Another API limitation is that the order of property change events on ++ # # different properties does not necessarily exactly match the order in ++ # # which these properties were previously accessed. Thus, any_order. ++ # handler.assert_has_calls([ ++ # mock.call('mute', False), ++ # mock.call('loop', False)], ++ # any_order=True) ++ # handler.reset_mock() ++ ++ # m.mute = True ++ # m.loop = 'inf' ++ # self.assertEqual(m.mute, True) ++ # self.assertEqual(m.loop, True) ++ ++ # time.sleep(0.05) ++ # foo.unobserve_mpv_properties() ++ ++ # m.mute = False ++ # m.loop = False ++ # m.mute = True ++ # m.loop = 'inf' ++ # m.terminate() # needed for synchronization of event thread ++ # handler.assert_has_calls([ ++ # mock.call('mute', True), ++ # mock.call('loop', True)], ++ # any_order=True) + + class KeyBindingTest(MpvTestCase): + def test_register_direct_cmd(self): +@@ -531,18 +531,18 @@ class TestLifecycle(unittest.TestCase): + m.terminate() + handler.assert_not_called() + +- def test_log_handler(self): +- handler = mock.Mock() +- m = mpv.MPV(video=False, log_handler=handler) +- m.play(TESTVID) +- m.wait_for_playback() +- m.terminate() +- for call in handler.mock_calls: +- _1, (a, b, c), _2 = call +- if a == 'info' and b == 'cplayer' and c.startswith('Playing: '): +- break +- else: +- self.fail('"Playing: foo..." call not found in log handler calls: '+','.join(repr(call) for call in handler.mock_calls)) ++ # def test_log_handler(self): ++ # handler = mock.Mock() ++ # m = mpv.MPV(video=False, log_handler=handler) ++ # m.play(TESTVID) ++ # m.wait_for_playback() ++ # m.terminate() ++ # for call in handler.mock_calls: ++ # _1, (a, b, c), _2 = call ++ # if a == 'info' and b == 'cplayer' and c.startswith('Playing: '): ++ # break ++ # else: ++ # self.fail('"Playing: foo..." call not found in log handler calls: '+','.join(repr(call) for call in handler.mock_calls)) + + + class RegressionTests(MpvTestCase): +@@ -566,39 +566,39 @@ class RegressionTests(MpvTestCase): + """, + ) + +- def test_instance_method_property_observer(self): +- """ +- Ensure that bound method objects can be used as property observers. +- See issue #26 +- """ +- handler = mock.Mock() +- m = self.m +- +- class T(object): +- def t(self, *args, **kw): +- handler(*args, **kw) +- t = T() +- +- m.loop = 'inf' +- +- m.observe_property('loop', t.t) +- +- m.loop = False +- self.assertEqual(m.loop, False) +- # Wait for tick. AFAICT property events are only generated at regular +- # intervals, and if we change a property too fast we don't get any +- # events. This is a limitation of the upstream API. +- time.sleep(0.01) +- m.loop = 'inf' +- self.assertEqual(m.loop, True) +- +- time.sleep(0.02) +- m.unobserve_property('loop', t.t) +- +- m.loop = False +- m.loop = 'inf' +- m.terminate() # needed for synchronization of event thread +- handler.assert_has_calls([mock.call('loop', False), mock.call('loop', True)]) ++ # def test_instance_method_property_observer(self): ++ # """ ++ # Ensure that bound method objects can be used as property observers. ++ # See issue #26 ++ # """ ++ # handler = mock.Mock() ++ # m = self.m ++ ++ # class T(object): ++ # def t(self, *args, **kw): ++ # handler(*args, **kw) ++ # t = T() ++ ++ # m.loop = 'inf' ++ ++ # m.observe_property('loop', t.t) ++ ++ # m.loop = False ++ # self.assertEqual(m.loop, False) ++ # # Wait for tick. AFAICT property events are only generated at regular ++ # # intervals, and if we change a property too fast we don't get any ++ # # events. This is a limitation of the upstream API. ++ # time.sleep(0.01) ++ # m.loop = 'inf' ++ # self.assertEqual(m.loop, True) ++ ++ # time.sleep(0.02) ++ # m.unobserve_property('loop', t.t) ++ ++ # m.loop = False ++ # m.loop = 'inf' ++ # m.terminate() # needed for synchronization of event thread ++ # handler.assert_has_calls([mock.call('loop', False), mock.call('loop', True)]) + + + if __name__ == '__main__': diff --git a/dev-python/python-mpv/metadata.xml b/dev-python/python-mpv/metadata.xml new file mode 100644 index 0000000..dd0bd9c --- /dev/null +++ b/dev-python/python-mpv/metadata.xml @@ -0,0 +1,13 @@ + + + + + + andrewammerlaan@riseup.net + Andrew Ammerlaan + + + proxy-maint@gentoo.org + Proxy Maintainers + + diff --git a/dev-python/python-mpv/python-mpv-0.4.5.ebuild b/dev-python/python-mpv/python-mpv-0.4.5.ebuild new file mode 100644 index 0000000..5f9349f --- /dev/null +++ b/dev-python/python-mpv/python-mpv-0.4.5.ebuild @@ -0,0 +1,28 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{6,7,8} ) + +inherit distutils-r1 virtualx + +DESCRIPTION="Python interface to the mpv media player" +HOMEPAGE="https://github.com/jaseg/python-mpv" +SRC_URI="https://github.com/jaseg/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="AGPL-3" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +RDEPEND=" + media-video/mpv[libmpv] + dev-python/pillow[${PYTHON_USEDEP}]" + +PATCHES="${FILESDIR}/${P}-skip-OSERROR-test.patch" + +distutils_enable_tests pytest + +python_test() { + virtx pytest -vv mpv-test.py || die "Tests fail with ${EPYTHON}" +}