Skip to content

Commit

Permalink
Update readme. Publish PyPI packages from tag builds (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ch00k committed Jul 30, 2024
1 parent b3898d0 commit 11a5d5b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 17 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
name: test
name: ci

on:
push:
branches: [ master ]
branches:
- master
tags:
- '**'
pull_request:
branches: [ master ]
branches:
- master

jobs:
lint:
Expand Down Expand Up @@ -37,7 +41,7 @@ jobs:
- "pypy3.8"
- "pypy3.9"
- "pypy3.10"
name: Python ${{ matrix.python-version }}
name: test ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand All @@ -53,3 +57,15 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true

publish:
runs-on: ubuntu-latest
name: publish
if: github.ref_type == 'tag'
needs:
- lint
- test
steps:
- run: poetry publish --build
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
16 changes: 9 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,24 @@ ffmpy
=====
*ffmpy* is a simple `FFmpeg <http://ffmpeg.org/>`_ command line wrapper. It implements a Pythonic interface for FFmpeg command line compilation and uses Python's `subprocess <https://docs.python.org/2/library/subprocess.html>`_ to execute the compiled command line.

*ffmpy* requires Python 3.8 or greater.

Installation
------------
You guessed it::
::

pip install ffmpy

Quick example
-------------
.. code:: python
>>> import ffmpy
>>> ff = ffmpy.FFmpeg(
... inputs={'input.mp4': None},
... outputs={'output.avi': None}
... )
>>> ff.run()
from ffmpy import FFmpeg
ff = FFmpeg(
inputs={'input.mp4': None},
outputs={'output.avi': None}
)
ff.run()
This will take the ``input.mp4`` file in the current directory as the input, change the video container from MP4 to AVI without changing any other video parameters, and create a new output file ``output.avi`` in the current directory.

Expand Down
14 changes: 8 additions & 6 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ ffmpy

At this moment *ffmpy* has wrappers for ``ffmpeg`` and ``ffprobe`` commands, but it should be possible to run other FFmpeg tools with it (e.g. ``ffserver``).

*ffmpy* requires Python 3.8 or greater.

Installation
------------
::
Expand All @@ -23,12 +25,12 @@ Quickstart
----------
::

>>> import ffmpy
>>> ff = ffmpy.FFmpeg(
... inputs={'input.mp4': None},
... outputs={'output.avi': None}
... )
>>> ff.run()
from ffmpy import FFmpeg
ff = FFmpeg(
inputs={'input.mp4': None},
outputs={'output.avi': None}
)
ff.run()

This takes ``input.mp4`` file in the current directory as the input, changes the video container from MP4 to AVI without changing any other video parameters and creates a new output file ``output.avi`` in the current directory.

Expand Down

0 comments on commit 11a5d5b

Please sign in to comment.