Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.

Commit 8d7fe12

Browse files
committed
completed pytest module
1 parent e8a76df commit 8d7fe12

File tree

8 files changed

+71
-55
lines changed

8 files changed

+71
-55
lines changed

.github/workflows/test_n_pub.yml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,8 @@ jobs:
1313
runs-on: ${{ matrix.os }}
1414
strategy:
1515
matrix:
16-
python-version: [3.7, 3.8, 3.9, "3.10"]
16+
python-version: ["3.10"]
1717
os: [ubuntu-latest, macos-latest, windows-latest]
18-
# python-version: [3.7, 3.8, 3.9]
19-
# os: [windows-latest]
20-
exclude:
21-
- os: macos-latest
22-
python-version: 3.7
23-
- os: windows-latest
24-
python-version: 3.7
25-
- os: macos-latest
26-
python-version: 3.8
27-
- os: windows-latest
28-
python-version: 3.8
29-
- os: macos-latest
30-
python-version: 3.9
31-
- os: windows-latest
32-
python-version: 3.9
3318

3419
steps:
3520
- run: echo ${{github.ref}}
@@ -44,8 +29,8 @@ jobs:
4429

4530
- name: Setup Python dependencies
4631
run: |
47-
python -m pip install -U pip
48-
pip install -U build pytest pytest-github-actions-annotate-failures
32+
python -m pip install -U pip setuptools wheel
33+
pip install -r requirements.txt
4934
5035
- name: Install ffmpegio-plugin-downloader package
5136
run: pip install -q .
@@ -68,8 +53,7 @@ jobs:
6853

6954
- name: Setup Python dependencies
7055
run: |
71-
python -m pip install -U pip setuptools
72-
pip install -U build
56+
python -m pip install -U pip setuptools wheel build
7357
7458
- name: Build a binary wheel and a source tarball
7559
run: python -m build --sdist --wheel --outdir dist/ .

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.rst

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,49 @@
33

44
|pypi| |pypi-status| |pypi-pyvers| |github-license| |github-status|
55

6-
.. |pypi| image:: https://img.shields.io/pypi/v/ffmpegio
6+
.. |pypi| image:: https://img.shields.io/pypi/v/ffmpegio-plugin-downloader
77
:alt: PyPI
8-
.. |pypi-status| image:: https://img.shields.io/pypi/status/ffmpegio
8+
.. |pypi-status| image:: https://img.shields.io/pypi/status/ffmpegio-plugin-downloader
99
:alt: PyPI - Status
10-
.. |pypi-pyvers| image:: https://img.shields.io/pypi/pyversions/ffmpegio
10+
.. |pypi-pyvers| image:: https://img.shields.io/pypi/pyversions/ffmpegio-plugin-downloader
1111
:alt: PyPI - Python Version
12-
.. |github-license| image:: https://img.shields.io/github/license/python-ffmpegio/python-ffmpegio
12+
.. |github-license| image:: https://img.shields.io/github/license/python-ffmpegio/python-ffmpegio-plugin-downloader
1313
:alt: GitHub License
14-
.. |github-status| image:: https://img.shields.io/github/workflow/status/python-ffmpegio/python-ffmpegio/Run%20Tests
14+
.. |github-status| image:: https://img.shields.io/github/workflow/status/python-ffmpegio/python-ffmpegio-plugin-downloader/Run%20Tests
1515
:alt: GitHub Workflow Status
1616

17-
Python `ffmpegio` package aims to bring the full capability of `FFmpeg <https://ffmpeg.org>`__
18-
to read, write, and manipulate multimedia data to Python. FFmpeg is an open-source cross-platform
19-
multimedia framework, which can handle most of the multimedia formats available today.
17+
`Python ffmpegio <https://python-ffmpegio.github.io/python-ffmpegio/>`__ package aims to bring
18+
the full capability of `FFmpeg <https://ffmpeg.org>`__ to read, write, and manipulate multimedia
19+
data to Python. FFmpeg is an open-source cross-platform multimedia framework, which can handle
20+
most of the multimedia formats available today.
2021

21-
`ffmpegio-plugin-downloader` adds a capability to download the latest release build of
22-
FFmpeg via officially acknowledged host servers.
22+
One caveat of FFmpeg is that there is no formal program installer for Windows and MacOS (although
23+
`homebrew` could be used for the latter). `ffmpegio-plugin-downloader` adds a capability to download
24+
the latest release build of FFmpeg and use it in `ffmpegio` without any user intervention. This
25+
mechanism is supported by `ffmpeg-downloader <https://github.com/python-ffmpegio/python-ffmpeg-downloader>__`
26+
package. Downloading of the release build must be performed manually from the terminal screen,
27+
outside of Python.
2328

24-
.. code-block:: bash
29+
Use
30+
===
31+
32+
Install the package (which also installs `ffmpeg-downloader` package). Then, run `ffmpeg_downloader` to
33+
download and install the latest release:
2534

26-
pip install ffmpegio-core # or ffmpegio if using it with its NumPy interface
35+
.. code-block:: bash
2736
2837
pip install ffmpegio_plugin_downloader
2938
3039
python -m ffmpeg_downloader # downloads and installs the latest release
3140
32-
Documentation
33-
-------------
41+
Once the plugin and the FFmpeg executables are installed, `ffmpegio` will automatically
42+
detects the downloaded executables. (Exception: `ffmpegio` searches the system PATH first.
43+
So, if `ffmpeg` and `ffprobe` are already available on the system, `ffmpegio_plugin_downloader`
44+
will never be called.)
45+
46+
At a later date, the installed FFmpeg can be updated to the latest release
47+
48+
.. code-block:: bash
49+
50+
python -m ffmpeg_downloader -U # downloads and updates to the latest release
3451
35-
Visit our `GitHub page here <https://python-ffmpegio.github.io/python-ffmpegio/>`__

ffmpegio

Lines changed: 0 additions & 1 deletion
This file was deleted.

setup.cfg

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
[metadata]
2-
name = ffmpegio
2+
name = ffmpegio-plugin-downloader
33
version = attr: ffmpegio_plugin_downloader.__version__
4-
description = ffmpegio plugin to download latest FFmpeg release
4+
description = ffmpegio plugin to download and use the latest FFmpeg release
55
long_description_content_type = text/x-rst
66
long_description = file: README.rst
77
keywords = multimedia, ffmpeg
88
license = GPL-2.0 License
9-
url=https://python-ffmpegio.github.io/python-ffmpegio
9+
url=https://python-ffmpegio.github.io/python-ffmpegio-plugin-downloader
1010
project_urls=
11-
Repository=https://github.com/python-ffmpegio/python-ffmpegio
12-
Discussions=https://github.com/python-ffmpegio/python-ffmpegio/discussions
13-
Issues=https://github.com/python-ffmpegio/python-ffmpegio/issues
14-
Pull Requests=https://github.com/python-ffmpegio/python-ffmpegio/pulls
11+
Repository=https://github.com/python-ffmpegio/python-ffmpegio-plugin-downloader
12+
Issues=https://github.com/python-ffmpegio/python-ffmpegio-plugin-downloader/issues
13+
Pull Requests=https://github.com/python-ffmpegio/python-ffmpegio-plugin-downloader/pulls
1514
classifiers =
1615
Development Status :: 4 - Beta
1716
License :: OSI Approved :: GNU General Public License v2 (GPLv2)
@@ -30,7 +29,6 @@ classifiers =
3029
package_dir=
3130
=src
3231
install_requires =
33-
ffmpegio-core >= 0.3.3
3432
ffmpeg-downloader
3533
python_requires = >=3.7,
3634
packages=ffmpegio_plugin_downloader

src/ffmpegio_plugin_downloader/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def finder():
1818
ffmpeg_path = ffdl.ffmpeg_path
1919

2020
if ffmpeg_path is None:
21-
logging.warn(
21+
logging.warning(
2222
"""ffmpegio-plugin-downloader is detected but the FFmpeg executables have not been installed. First, run in the terminal:
2323
2424
python -m ffmpeg_downloader

tests/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
pytest
1+
pytest
2+
ffmpegio-core

tests/test_base.py

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,32 @@
1-
from ffmpegio import plugins
1+
import ffmpegio_plugin_downloader
2+
import ffmpeg_downloader as ffdl
3+
import pytest
4+
from ffmpegio import plugins, path
25

36

4-
def test_hooks():
5-
hook = plugins.get_hook().finder
6-
print(hook)
7-
print(plugins.pm.get_plugins())
7+
@pytest.fixture(scope="module", autouse=True)
8+
def ffmpeg():
9+
install = ffdl.ffmpeg_path is None
10+
try:
11+
if install:
12+
ffdl.update(True)
13+
print('loaded')
14+
yield
15+
print('done')
16+
finally:
17+
if install:
18+
ffdl.remove()
19+
20+
21+
def test_plugin():
22+
assert ffmpegio_plugin_downloader in plugins.pm.get_plugins()
23+
24+
25+
def test_operation(ffmpeg):
26+
path.find()
27+
assert path.get_ffmpeg() == ffdl.ffmpeg_path
28+
assert path.get_ffmpeg(True) == ffdl.ffprobe_path
829

930

1031
if __name__ == "__main__":
11-
test_hooks()
32+
test_operation()

0 commit comments

Comments
 (0)