diff options
Diffstat (limited to 'dev-python/ffmpeg-python')
3 files changed, 248 insertions, 0 deletions
diff --git a/dev-python/ffmpeg-python/Manifest b/dev-python/ffmpeg-python/Manifest index ff3951e2e5ff..5afe16f8f92b 100644 --- a/dev-python/ffmpeg-python/Manifest +++ b/dev-python/ffmpeg-python/Manifest @@ -1,5 +1,8 @@ AUX ffmpeg-python-0.2.0-_run.py-collections.patch 507 BLAKE2B 6e503e627656775c4cc665ff68adf4afd8ed36131b2d55cdd00d420aefbb69d1585ddc8ec6513b64ddcea1a20d0d522d9d9d0d885c1d03e7d11de3741543782c SHA512 571087d23eec2880de37cec5799f967a2cb498b56e1109e086ead82cf65f8fac94cbc9c63953954f7ab3b59970285ecc18f5c446fc930a0c09ac8552251d47ec +AUX ffmpeg-python-0.2.0-no-future-795.patch 6088 BLAKE2B 259372f7b0ab18eecc387ccda08b9ef668c7323ce7685ac397c086f8de4d3299b4822b1307b44a1fa0cec7ddf5095ef4b9d388303c36ada6e87e56c2f0399db6 SHA512 cd1e666de2f64b6b9955dc351e694aa8a40cb3de3cfc36fae2cd8bfeb8c0d9c82230151586a6085261a4c4fdb9f4547aac6284956162c8ab958019a577677023 AUX ffmpeg-python-0.2.0-setup.py-pytest-runner.patch 366 BLAKE2B 874898215b2102406fa11ab4e2289671dc03a8b40a8831aa6958048b94c64a5cd1cd34d326539144ebe549046cb0df074e6ffb4b37a72aaa44d94c0bc161cfb6 SHA512 627bfc39b3f0feef02306d73d8dc113673483e0e1aa5182cada9d12195413d7638b94071a76b546092061d6916d45575a42aa5d949c8bd9df737c34b1b62ea71 DIST ffmpeg-python-0.2.0.tar.gz 3267771 BLAKE2B 8bca4a24434b6c7a542e3c178cb7bf1e5650f9763636d5378f9652cdd07ef19b0e96007d6bb71fdf1664efb6e33d597844c7d6a44dc8dcb1c083e21f53649469 SHA512 933ed958d61536bbbc0e0b08e19521c4b1f7df1cfe97de0b3d149a2748c5bd74915a3134861e8ecb1f92d5860315228b76aefcd087fcf07e188a56c651f5e301 +DIST ffmpeg-python-0.2.0_p20220711.gh.tar.gz 3286678 BLAKE2B f2dd4445f43ebf2a867d528e24e80b137ddc099770069e1fdf081b640f8ea192ee0b17c26d9ee3d8a69a9c7bbd61d0b75cc3468aa5da4fdd809e50126dff4e06 SHA512 81f20e5cad819500b941d9ac579fe01efb4292f61e6279c6d560d70c11143d7c04146a8ccf9ae8ab6985cf04e6b7cc05849ec67df646caa75764f3a2c5761cde EBUILD ffmpeg-python-0.2.0.ebuild 917 BLAKE2B d62bec0570717bd80bb3d6b400467c6a2a5e5653bbe0fe5402e71ae42f0ffb42244caff0bcbe5e9c610cd799999ec1a7912190bbda54ad1d19a0aea2615dd367 SHA512 1726b029f532ecdcdd73adc4498cecf380a5b7ce78c96f4b7ae8b3dac11bbab3c1862b569081a1af54fdd66ff8db088eb957fbc6b2d740e471a95661a79ca564 +EBUILD ffmpeg-python-0.2.0_p20220711.ebuild 1409 BLAKE2B 8cf02ec06819c3fbb60586b2c608c6a3f427a127838f7badd658a9ba9a2d06f06a83b1a3010dab4378a592de786c86d528b22e55e334564cdadc072ba7fa05ca SHA512 38562a541681e01bf19a4751479b811defa86448799e0e7dfd6574139c96753aca707e19384d1ad22426b1874c2ba889c4af39197b3c94f92a51507cc792e53e MISC metadata.xml 577 BLAKE2B b155f565cf1946c705d3e9ad1a6f350235eebbb065bd109e53825cac7103c266f5fe675795daeeee960c36857e7ba88e72694ea42a7f5630117194bb9a72891d SHA512 aad6a67315534a72e86b1cf3146f7f43612c1e3a3782a681541e4ed4e6d5be70b2f1d46167fd0dd7efbe3bb07699787423b609b5da27a13e65081014adcd1653 diff --git a/dev-python/ffmpeg-python/ffmpeg-python-0.2.0_p20220711.ebuild b/dev-python/ffmpeg-python/ffmpeg-python-0.2.0_p20220711.ebuild new file mode 100644 index 000000000000..ad656ad67636 --- /dev/null +++ b/dev-python/ffmpeg-python/ffmpeg-python-0.2.0_p20220711.ebuild @@ -0,0 +1,56 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +[[ "${PV}" == *_p20220711 ]] && COMMIT=df129c7ba30aaa9ffffb81a48f53aa7253b0b4e6 +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..12} ) + +inherit distutils-r1 + +DESCRIPTION="Python bindings for FFmpeg with complex filtering support" +HOMEPAGE="https://github.com/kkroening/ffmpeg-python/" + +if [[ "${PV}" == *9999* ]] ; then + inherit git-r3 + + EGIT_REPO_URI="https://github.com/kkroening/${PN}.git" +else + SRC_URI="https://github.com/kkroening/${PN}/archive/${COMMIT}.tar.gz + -> ${P}.gh.tar.gz" + S="${WORKDIR}/${PN}-${COMMIT}" + + KEYWORDS="~amd64 ~x86" +fi + +LICENSE="Apache-2.0" +SLOT="0" + +RDEPEND=" + dev-python/numpy[${PYTHON_USEDEP}] + media-video/ffmpeg +" +BDEPEND=" + test? ( + dev-python/pytest-mock[${PYTHON_USEDEP}] + ) +" + +PATCHES=( + "${FILESDIR}/${PN}-0.2.0-no-future-795.patch" +) + +EPYTEST_DESELECT=( + ffmpeg/tests/test_ffmpeg.py::test__get_filter_complex_input + ffmpeg/tests/test_ffmpeg.py::test__input__start_time + ffmpeg/tests/test_ffmpeg.py::test__multi_output_edge_label_order + ffmpeg/tests/test_ffmpeg.py::test__probe + ffmpeg/tests/test_ffmpeg.py::test__probe__extra_args + ffmpeg/tests/test_ffmpeg.py::test_fluent_complex_filter + ffmpeg/tests/test_ffmpeg.py::test_pipe + ffmpeg/tests/test_ffmpeg.py::test_repeated_args +) + +distutils_enable_tests pytest +distutils_enable_sphinx doc/src diff --git a/dev-python/ffmpeg-python/files/ffmpeg-python-0.2.0-no-future-795.patch b/dev-python/ffmpeg-python/files/ffmpeg-python-0.2.0-no-future-795.patch new file mode 100644 index 000000000000..8bbc29ab8b21 --- /dev/null +++ b/dev-python/ffmpeg-python/files/ffmpeg-python-0.2.0-no-future-795.patch @@ -0,0 +1,189 @@ +From 6abf0354bced3fc5f3a592870723c7446ae8747d Mon Sep 17 00:00:00 2001 +From: Lumir Balhar <lbalhar@redhat.com> +Date: Wed, 20 Sep 2023 14:18:16 +0200 +Subject: [PATCH] Remove dependency on `future` + +--- + ffmpeg/_ffmpeg.py | 5 +---- + ffmpeg/_run.py | 6 +++--- + ffmpeg/_utils.py | 36 +----------------------------------- + ffmpeg/nodes.py | 3 +-- + requirements.txt | 1 - + setup.py | 3 +-- + tox.ini | 1 - + 7 files changed, 7 insertions(+), 48 deletions(-) + +diff --git a/ffmpeg/_ffmpeg.py b/ffmpeg/_ffmpeg.py +index 007624bb..57dc0c96 100644 +--- a/ffmpeg/_ffmpeg.py ++++ b/ffmpeg/_ffmpeg.py +@@ -1,8 +1,5 @@ + from __future__ import unicode_literals + +-from past.builtins import basestring +-from ._utils import basestring +- + from .nodes import ( + filter_operator, + GlobalNode, +@@ -79,7 +76,7 @@ def output(*streams_and_filename, **kwargs): + """ + streams_and_filename = list(streams_and_filename) + if 'filename' not in kwargs: +- if not isinstance(streams_and_filename[-1], basestring): ++ if not isinstance(streams_and_filename[-1], str): + raise ValueError('A filename must be provided') + kwargs['filename'] = streams_and_filename.pop(-1) + streams = streams_and_filename +diff --git a/ffmpeg/_run.py b/ffmpeg/_run.py +index f42d1d73..7a8b3937 100644 +--- a/ffmpeg/_run.py ++++ b/ffmpeg/_run.py +@@ -1,6 +1,6 @@ + from __future__ import unicode_literals + from .dag import get_outgoing_edges, topo_sort +-from ._utils import basestring, convert_kwargs_to_cmd_line_args ++from ._utils import convert_kwargs_to_cmd_line_args + from builtins import str + from functools import reduce + import copy +@@ -140,7 +140,7 @@ def _get_output_args(node, stream_name_map): + args += ['-b:a', str(kwargs.pop('audio_bitrate'))] + if 'video_size' in kwargs: + video_size = kwargs.pop('video_size') +- if not isinstance(video_size, basestring) and isinstance(video_size, Iterable): ++ if not isinstance(video_size, str) and isinstance(video_size, Iterable): + video_size = '{}x{}'.format(video_size[0], video_size[1]) + args += ['-video_size', video_size] + args += convert_kwargs_to_cmd_line_args(kwargs) +@@ -185,7 +185,7 @@ def compile(stream_spec, cmd='ffmpeg', overwrite_output=False): + This is the same as calling :meth:`get_args` except that it also + includes the ``ffmpeg`` command as the first argument. + """ +- if isinstance(cmd, basestring): ++ if isinstance(cmd, str): + cmd = [cmd] + elif type(cmd) != list: + cmd = list(cmd) +diff --git a/ffmpeg/_utils.py b/ffmpeg/_utils.py +index 9baa2c78..21f612ea 100644 +--- a/ffmpeg/_utils.py ++++ b/ffmpeg/_utils.py +@@ -1,31 +1,9 @@ + from __future__ import unicode_literals + from builtins import str +-from past.builtins import basestring + import hashlib + import sys + + +-if sys.version_info.major == 2: +- # noinspection PyUnresolvedReferences,PyShadowingBuiltins +- str = str +- +-try: +- from collections.abc import Iterable +-except ImportError: +- from collections import Iterable +- +- +-# `past.builtins.basestring` module can't be imported on Python3 in some environments (Ubuntu). +-# This code is copy-pasted from it to avoid crashes. +-class BaseBaseString(type): +- def __instancecheck__(cls, instance): +- return isinstance(instance, (bytes, str)) +- +- def __subclasshook__(cls, thing): +- # TODO: What should go here? +- raise NotImplemented +- +- + def with_metaclass(meta, *bases): + class metaclass(meta): + __call__ = type.__call__ +@@ -39,25 +17,13 @@ def __new__(cls, name, this_bases, d): + return metaclass('temporary_class', None, {}) + + +-if sys.version_info.major >= 3: +- +- class basestring(with_metaclass(BaseBaseString)): +- pass +- +-else: +- # noinspection PyUnresolvedReferences,PyCompatibility +- from builtins import basestring +- +- + def _recursive_repr(item): + """Hack around python `repr` to deterministically represent dictionaries. + + This is able to represent more things than json.dumps, since it does not require + things to be JSON serializable (e.g. datetimes). + """ +- if isinstance(item, basestring): +- result = str(item) +- elif isinstance(item, list): ++ if isinstance(item, list): + result = '[{}]'.format(', '.join([_recursive_repr(x) for x in item])) + elif isinstance(item, dict): + kv_pairs = [ +diff --git a/ffmpeg/nodes.py b/ffmpeg/nodes.py +index e8b28385..cc219c72 100644 +--- a/ffmpeg/nodes.py ++++ b/ffmpeg/nodes.py +@@ -1,6 +1,5 @@ + from __future__ import unicode_literals + +-from past.builtins import basestring + from .dag import KwargReprNode + from ._utils import escape_chars, get_hash_int + from builtins import object +@@ -68,7 +67,7 @@ def __getitem__(self, index): + """ + if self.selector is not None: + raise ValueError('Stream already has a selector: {}'.format(self)) +- elif not isinstance(index, basestring): ++ elif not isinstance(index, str): + raise TypeError("Expected string index (e.g. 'a'); got {!r}".format(index)) + return self.node.stream(label=self.label, selector=index) + +diff --git a/requirements.txt b/requirements.txt +index f8b347e9..b4bc370e 100644 +--- a/requirements.txt ++++ b/requirements.txt +@@ -6,7 +6,6 @@ certifi==2019.3.9 + chardet==3.0.4 + docutils==0.14 + filelock==3.0.12 +-future==0.17.1 + idna==2.8 + imagesize==1.1.0 + importlib-metadata==0.17 +diff --git a/setup.py b/setup.py +index 72f381cb..2fbf9a3d 100644 +--- a/setup.py ++++ b/setup.py +@@ -68,10 +68,9 @@ + download_url=download_url, + keywords=keywords, + long_description=long_description, +- install_requires=['future'], ++ install_requires=[], + extras_require={ + 'dev': [ +- 'future==0.17.1', + 'numpy==1.16.4', + 'pytest-mock==1.10.4', + 'pytest==4.6.1', +diff --git a/tox.ini b/tox.ini +index 98814078..eb8c6622 100644 +--- a/tox.ini ++++ b/tox.ini +@@ -19,6 +19,5 @@ python = + [testenv] + commands = py.test -vv + deps = +- future + pytest + pytest-mock |