8000 Use GitHub Actions for CI. (#641) · rwindwh/ffmpeg-python@29b6f09 · GitHub
[go: up one dir, main page]

Skip to content

Commit 29b6f09

Browse files
authored
Use GitHub Actions for CI. (kkroening#641)
This sets up GitHub Actions (GHA) to run in place of the currently broken Travis CI. Initially, this only covers running tox/pytest and Black, but may eventually be extended to run pylint, mypy, flake8, etc. - see kkroening#605, for example. Notes: * Python 3.10 is not yet supported due to the `collections.Iterable` issue discussed in kkroening#330, kkroening#624, etc. * The Black CI step acts as a linting step, rather than attempting to have the GHA job automatically update/commit/push the reformarted code. * Black is currently pinned to an older version that supports `--target-version py27` until Python 2 compatibility can be dropped in the final Python 2 compatibility release of ffmpeg-python. * Only the main source directory (`ffmpeg/`) is checked with Black at the moment. The `examples/` directory should also be checked, but will be done as a separate PR. Co-authored by: Christian Clauss <cclauss@me.com>
1 parent fd1da13 commit 29b6f09

File tree

6 files changed

+58
-37
lines changed

6 files changed

+58
-37
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
on:
3+
- push
4+
- pull_request
5+
jobs:
6+
test:
7+
runs-on: ubuntu-20.04
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
python-version:
12+
- "2.7"
13+
- "3.5"
14+
- "3.6"
15+
- "3.7"
16+
- "3.8"
17+
- "3.9"
18+
# - "3.10" # FIXME: broken due to `collections.Iterable` issue; see #330 / #624 / etc.
19+
steps:
20+
- uses: actions/checkout@v1
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- name: Install ffmpeg
26+
run: |
27+
sudo apt update
28+
sudo apt install ffmpeg
29+
- name: Setup pip + tox
30+
run: |
31+
python -m pip install --upgrade \
32+
"pip==20.3.4; python_version < '3.6'" \
33+
"pip==21.3.1; python_version >= '3.6'"
34+
python -m pip install tox==3.24.5 tox-gh-actions==2.9.1
35+
- name: Test with tox
36+
run: tox
37+
black:
38+
runs-on: ubuntu-20.04
39+
steps:
40+
- uses: actions/checkout@v2
41+
- uses: psf/black@21.12b0 # TODO: upgrade after dropping Python 2 support.
42+
with:
43+
src: ffmpeg # TODO: also format `examples`.
44+
version: 21.12b0

.travis.yml

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

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# ffmpeg-python: Python bindings for FFmpeg
22

3-
[![Build status](https://travis-ci.org/kkroening/ffmpeg-python.svg?branch=master)](https://travis-ci.org/kkroening/ffmpeg-python)
3+
[![CI][ci-badge]][ci]
4+
5+
[ci-badge]: https://github.com/kkroening/ffmpeg-python/actions/workflows/ci.yml/badge.svg
6+
[ci]: https://github.com/kkroening/ffmpeg-python/actions/workflows/ci.yml
47

58
<img src="https://raw.githubusercontent.com/kkroening/ffmpeg-python/master/doc/formula.png" alt="ffmpeg-python logo" width="60%" />
69

ffmpeg/_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def __new__(cls, name, this_bases, d):
4040
class basestring(with_metaclass(BaseBaseString)):
4141
pass
4242

43-
4443
else:
4544
# noinspection PyUnresolvedReferences,PyCompatibility
4645
from builtins import basestring

setup.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@
6060
setup(
6161
name='ffmpeg-python',
6262
packages=['ffmpeg'],
63-
setup_requires=['pytest-runner'],
64-
tests_require=['pytest', 'pytest-mock'],
6563
version=version,
6664
description='Python bindings for FFmpeg - with complex filtering support',
6765
author='Karl Kroening',

tox.ini

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,16 @@
44
# and then run "tox" from this directory.
55

66
[tox]
7-
envlist = py27, py34, py35, py36, py37, pypy
7+
envlist = py27, py35, py36, py37, py38, py39
8+
9+
[gh-actions]
10+
python =
11+
2.7: py27
12+
3.5: py35
13+
3.6: py36
14+
3.7: py37
15+
3.8: py38
16+
3.9: py39
817

918
[testenv]
1019
commands = py.test -vv

0 commit comments

Comments
 (0)
0