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 740abbf
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 26 deletions.
31 changes: 27 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,22 @@ 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:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
architecture: x64
- run: |
pip install poetry
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
9 changes: 2 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@
# -*- coding: utf-8 -*-

import datetime
import os
import sys
from typing import Dict

sys.path.insert(0, os.path.abspath("..")) # noqa
import ffmpy # noqa

extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
Expand All @@ -22,8 +17,8 @@
copyright = f"2015-{datetime.datetime.now().year}, Andrii Yurchuk"
author = "Andrii Yurchuk"

version = ffmpy.__version__
release = ffmpy.__version__
version = "0.4.0"
release = "0.4.0"

language = "en"

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
2 changes: 0 additions & 2 deletions ffmpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import subprocess
from typing import IO, Any, List, Mapping, Optional, Sequence, Tuple, Union

__version__ = "0.3.3"


class FFmpeg(object):
"""Wrapper for various `FFmpeg <https://www.ffmpeg.org/>`_ related applications (ffmpeg,
Expand Down

0 comments on commit 740abbf

Please sign in to comment.