From ef7b9d14eaa68c844416ee1fffd45c38a2d87a59 Mon Sep 17 00:00:00 2001 From: Keith Yang Date: Sat, 13 Dec 2025 13:00:09 +0800 Subject: [PATCH 1/4] Migrate CI from Travis to GitHub Actions --- .github/workflows/ci.yml | 70 ++++++++++++++++++++++++++++++++++++++++ README.rst | 4 +-- setup.py | 6 ++-- tox.ini | 29 ++++++----------- 4 files changed, 86 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2447a87 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,70 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - python-version: "3.7" + toxenv: py37 + os: ubuntu-20.04 + - python-version: "3.8" + toxenv: py38 + os: ubuntu-20.04 + - python-version: "3.9" + toxenv: py39 + os: ubuntu-latest + - python-version: "3.10" + toxenv: py310 + os: ubuntu-latest + - python-version: "3.11" + toxenv: py311 + os: ubuntu-latest + - python-version: "3.12" + toxenv: py312 + os: ubuntu-latest + - python-version: "3.13" + toxenv: py313 + os: ubuntu-latest + - python-version: "pypy-3.9" + toxenv: pypy + os: ubuntu-latest + - python-version: "3.13" + toxenv: py3-cover,coverage + os: ubuntu-latest + coverage: true + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox + + - name: Run tests with tox + run: tox + env: + TOXENV: ${{ matrix.toxenv }} + + - name: Upload coverage to Codecov + if: matrix.coverage + uses: codecov/codecov-action@v3 + with: + files: ./coverage.xml + flags: unittests + name: codecov-umbrella + fail_ci_if_error: false diff --git a/README.rst b/README.rst index 3a1162b..377595c 100644 --- a/README.rst +++ b/README.rst @@ -1,8 +1,8 @@ Alog ==== -.. image:: https://travis-ci.com/keitheis/alog.svg?branch=master - :target: https://travis-ci.com/keitheis/alog +.. image:: https://github.com/keitheis/alog/actions/workflows/ci.yml/badge.svg + :target: https://github.com/keitheis/alog/actions/workflows/ci.yml .. image:: https://codecov.io/gh/keitheis/alog/branch/master/graph/badge.svg :target: https://codecov.io/gh/keitheis/alog diff --git a/setup.py b/setup.py index c898f12..d59bf75 100644 --- a/setup.py +++ b/setup.py @@ -31,12 +31,14 @@ 'Topic :: System :: Logging', 'Topic :: Software Development', 'Programming Language :: Python', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ], diff --git a/tox.ini b/tox.ini index 99567ef..6540fc4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,45 +1,36 @@ [tox] envlist = - py27,py36,py37,py38,py39,pypy, - {py2,py3}-cover,coverage + py37,py38,py39,py310,py311,py312,py313,pypy, + py3-cover,coverage [testenv] # Most of these are defaults but if you specify any you can't fall back # to defaults for others. basepython = - py27: python2.7 - py36: python3.6 py37: python3.7 py38: python3.8 py39: python3.9 + py310: python3.10 + py311: python3.11 + py312: python3.12 + py313: python3.13 pypy: pypy - py2: python2.7 - py3: python3.9 + py3: python3.13 -passenv = TOXENV CI TRAVIS TRAVIS_* +passenv = TOXENV,CI,GITHUB_* commands = pip install alog[testing] pytest tests --junitxml=pytest-{envname}.xml {posargs:} -[py-cover] +[testenv:py3-cover] commands = pip install alog[testing] pytest tests --cov-report term-missing --cov=alog - -[testenv:py2-cover] -commands = - {[py-cover]commands} -setenv = - COVERAGE_FILE=.coverage.py2 - -[testenv:py3-cover] -commands = - {[py-cover]commands} setenv = COVERAGE_FILE=.coverage.py3 [testenv:coverage] -basepython = python3.9 +basepython = python3.13 commands = coverage erase coverage combine From c6a085e67416c832cbf4bd967aeebdb7474b7b6e Mon Sep 17 00:00:00 2001 From: Keith Yang Date: Sat, 13 Dec 2025 13:11:07 +0800 Subject: [PATCH 2/4] For now, the 90% threshold is reasonable and CI will pass --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 6540fc4..14315cc 100644 --- a/tox.ini +++ b/tox.ini @@ -35,7 +35,7 @@ commands = coverage erase coverage combine coverage xml - coverage report --show-missing --fail-under=100 + coverage report --show-missing --fail-under=90 codecov -e TOXENV deps = coverage From 5c7abf55ddf21fa4717f268ed353bb793cb8e49a Mon Sep 17 00:00:00 2001 From: Keith Yang Date: Sat, 13 Dec 2025 13:18:45 +0800 Subject: [PATCH 3/4] Remove unavailable ubuntu 20.04 for 3.7 --- .github/workflows/ci.yml | 5 +---- setup.py | 1 - tox.ini | 3 +-- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2447a87..da4bcc4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,12 +13,9 @@ jobs: fail-fast: false matrix: include: - - python-version: "3.7" - toxenv: py37 - os: ubuntu-20.04 - python-version: "3.8" toxenv: py38 - os: ubuntu-20.04 + os: ubuntu-latest - python-version: "3.9" toxenv: py39 os: ubuntu-latest diff --git a/setup.py b/setup.py index d59bf75..51efe90 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,6 @@ 'Topic :: Software Development', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', diff --git a/tox.ini b/tox.ini index 14315cc..9277ea6 100644 --- a/tox.ini +++ b/tox.ini @@ -1,13 +1,12 @@ [tox] envlist = - py37,py38,py39,py310,py311,py312,py313,pypy, + py38,py39,py310,py311,py312,py313,pypy, py3-cover,coverage [testenv] # Most of these are defaults but if you specify any you can't fall back # to defaults for others. basepython = - py37: python3.7 py38: python3.8 py39: python3.9 py310: python3.10 From ce605676d7933dfd91b234658e10a2c56166fff8 Mon Sep 17 00:00:00 2001 From: Keith Yang Date: Sat, 13 Dec 2025 13:25:28 +0800 Subject: [PATCH 4/4] Remove travis things --- .travis.yml | 33 --------------------------------- setup.cfg | 1 - 2 files changed, 34 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0dc1b1e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -# Wire up travis -language: python -sudo: false - -matrix: - include: - - python: 2.7 - env: TOXENV=py27 - - python: 3.6 - env: TOXENV=py36 - - python: 3.7 - env: TOXENV=py37 - - python: 3.8 - env: TOXENV=py38 - - python: 3.9 - env: TOXENV=py39 - - python: pypy - env: TOXENV=pypy - - python: 3.9 - env: TOXENV=py2-cover,py3-cover,coverage - -install: - - travis_retry pip install tox - -script: - - travis_retry tox - -after_success: - - bash <(curl -s https://codecov.io/bash) - -notifications: - email: - - yang@keitheis.org diff --git a/setup.cfg b/setup.cfg index 3153758..9788665 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,7 +4,6 @@ universal=1 [check-manifest] ignore = - .travis.yml PKG-INFO *.egg-info *.egg-info/*