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 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