From 18acbf4e2ff25c59f97a148b8bc5ba0a17cf9c26 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Thu, 23 Nov 2023 14:32:33 +0200 Subject: [PATCH 1/2] Replace Travis CI with GitHub Actions --- .github/workflows/test.yml | 41 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 29 --------------------------- README.md | 3 ++- setup.cfg | 3 +++ tox.ini | 23 +++++++++++++++++++++ 5 files changed, 69 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml create mode 100644 tox.ini diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..7ba01e4 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,41 @@ +name: Test + +on: [push, pull_request, workflow_dispatch] + +env: + FORCE_COLOR: 1 + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + python-version: ["pypy3.10", "3.8", "3.9", "3.10", "3.11", "3.12"] + os: [windows-latest, macos-latest, ubuntu-latest] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + allow-prereleases: true + cache: pip + cache-dependency-path: setup.cfg + + - name: Install dependencies + run: | + python -m pip install -U pip + python -m pip install -U tox + + - name: Tox tests + run: | + tox -e py + + - name: Upload coverage + uses: codecov/codecov-action@v3 + with: + flags: ${{ matrix.os }} + name: ${{ matrix.os }} Python ${{ matrix.python-version }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 72aa8ac..0000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: python -cache: pip - -matrix: - include: - - python: 2.7 - - python: 3.5 - - python: 3.6 - - python: 3.7 - - python: 3.8 - - python: 3.9-dev - - python: pypy - - python: pypy3 - -install: - - pip install coverage - -script: - - coverage run --source=olefile -m nose tests - -after_success: - - pip install coveralls - - coveralls - -after_script: - - coverage report - - pip install pycodestyle pyflakes - - pyflakes . - - pycodestyle --statistics --count . diff --git a/README.md b/README.md index ecaf55b..538bcae 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ olefile ======= +[![Test](https://github.com/decalage2/olefile/actions/workflows/test.yml/badge.svg)](https://github.com/decalage2/olefile/actions) [![Build Status AppVeyor](https://ci.appveyor.com/api/projects/status/github/decalage2/olefile?svg=true)](https://ci.appveyor.com/project/decalage2/olefile) -[![Coverage Status](https://coveralls.io/repos/github/decalage2/olefile/badge.svg?branch=master)](https://coveralls.io/github/decalage2/olefile?branch=master) +[![codecov](https://codecov.io/gh/decalage2/olefile/branch/main/graph/badge.svg)](https://codecov.io/gh/decalage2/olefile) [![Documentation Status](http://readthedocs.org/projects/olefile/badge/?version=latest)](http://olefile.readthedocs.io/en/latest/?badge=latest) [![PyPI](https://img.shields.io/pypi/v/olefile.svg)](https://pypi.org/project/olefile/) [![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/decalage2) diff --git a/setup.cfg b/setup.cfg index 2e9053c..836b2c0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,6 @@ +[options.extras_require] +tests = pytest; pytest-cov + [bdist_wheel] universal = 1 diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..ea27911 --- /dev/null +++ b/tox.ini @@ -0,0 +1,23 @@ +[tox] +requires = + tox>=4.2 +env_list = + py{py3, 312, 311, 310, 39, 38} + +[testenv] +extras = + tests +commands = + {envpython} -m pytest \ + --cov olefile \ + --cov tests \ + --cov-report html \ + --cov-report term \ + --cov-report xml \ + {posargs} + +[testenv:pins] +extras = + None +commands_pre = + {envpython} -m pip install -r requirements.txt From 76aed54cbed04178afff9d44df3940beb7bd5635 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Fri, 24 Nov 2023 13:54:36 +0200 Subject: [PATCH 2/2] Don't complain about non-runnable main() --- .coveragerc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.coveragerc b/.coveragerc index 150632c..316ef30 100644 --- a/.coveragerc +++ b/.coveragerc @@ -9,5 +9,7 @@ exclude_lines = # Don't complain if non-runnable code isn't run: if 0: if __name__ == .__main__.: + def main + # Don't complain about debug code log.debug