Skip to content

CI: migrate from Travis to GitHub Actions #353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on: [ push, pull_request ]

jobs:
CI:
name: "Linux x64 (Ubuntu 22.04) - Python ${{ matrix.python-version }}"
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
# Only test supported Python versions:
# https://endoflife.date/python
python-version: ["3.7", "3.8", "3.9", "3.10", "pypy3.9"]

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install libvips
run: sudo apt-get install --no-install-recommends libvips

- name: Lint with flake8
run: |
pip install flake8
flake8 .

- name: Install tox and any other packages
run: pip install tox

- name: Run tox
# Run tox using the version of Python in `PATH`
run: tox -e py
72 changes: 0 additions & 72 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
README
======

.. image:: https://travis-ci.org/libvips/pyvips.svg?branch=master
.. image:: https://github.com/libvips/pyvips/workflows/CI/badge.svg
:alt: Build Status
:target: https://travis-ci.org/libvips/pyvips
:target: https://github.com/libvips/pyvips/actions

PyPI package:

Expand Down
1 change: 1 addition & 0 deletions examples/gen-enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,5 @@ def add_enum(gtype, a, b):

if __name__ == "__main__":
print('# libvips enums -- this file is generated automatically')
print('# flake8: noqa: E501') # ignore line too long error
generate_enums()
1 change: 1 addition & 0 deletions pyvips/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def at_least_libvips(x, y):

return major > x or (major == x and minor >= y)


def type_find(basename, nickname):
"""Get the GType for a name.

Expand Down
1 change: 1 addition & 0 deletions pyvips/enums.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# libvips enums -- this file is generated automatically
# flake8: noqa: E501


class BandFormat(object):
Expand Down
2 changes: 1 addition & 1 deletion pyvips/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
text_type = str, Path
byte_type = bytes
else:
text_type = unicode
text_type = unicode # noqa: F821
byte_type = str


Expand Down
2 changes: 1 addition & 1 deletion pyvips/gvalue.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def to_enum(gtype, value):

"""

if isinstance(value, basestring if _is_PY2 else str):
if isinstance(value, basestring if _is_PY2 else str): # noqa: F821
enum_value = vips_lib.vips_enum_from_nick(b'pyvips', gtype,
_to_bytes(value))
if enum_value < 0:
Expand Down
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@

test_deps = [
'cffi>=1.0.0',
'pytest-runner',
'pytest',
'pytest-flake8',
'pyperf',
]

Expand Down
4 changes: 2 additions & 2 deletions tests/test_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_operation_block(self):

# should fail
with pytest.raises(Exception):
image = pyvips.Image.new_from_file(WEBP_FILE)
_ = pyvips.Image.new_from_file(WEBP_FILE)

# reenable all loads
pyvips.operation_block_set("VipsForeignLoad", False)
Expand All @@ -41,7 +41,7 @@ def test_block_untrusted(self):

# should fail
with pytest.raises(Exception):
image = pyvips.Image.new_from_file(SVG_FILE)
_ = pyvips.Image.new_from_file(SVG_FILE)

# reenable all loads
pyvips.block_untrusted_set(False)
34 changes: 8 additions & 26 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,35 +1,17 @@
[tox]
skipdist = true

envlist =
py{27,33,34,35,36,37,38,39,py310,py,py3}-test
qa
doc

[travis]
python =
2.7: test
3.3: test
3.4: test
3.5: test
3.6: test
3.7: test
3.8: test
3.9: test
3.10: test, doc
pypy: test
pypy3: test
envlist = py{37,38,39,310,py39}-test

[pytest]
norecursedirs = .eggs build tmp* vips-*
log_level = WARNING

[testenv]
commands =
test: python setup.py test
qa: pip install -e .[test]
qa: pytest --flake8
doc: pip install -e .[doc]
doc: sphinx-build -n -b html doc doc/build/html
passenv =
PKG_CONFIG_PATH
extras = test
commands = pytest
passenv = PKG_CONFIG_PATH

[testenv:doc]
extras = doc
commands = sphinx-build -n -b html doc doc/build/html