From 4c876a3cd444300c7207625f60bd5bc87c3de801 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 7 Jan 2021 16:50:40 +0100 Subject: [PATCH 01/11] Add Tox environments for c90, c99 and c++, as in the CI tests --- tox.ini | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index fdde49f..75cbd23 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,14 @@ [tox] -envlist = py27,py34,py35,py36,py37,py38,py39 +envlist = py{27,34,35,36}-{c90,c99,cpp},py{37,38,39,310}-{c99,cpp} skipsdist = True [testenv] +allowlist_externals = make commands = make test-python +setenv= + c90: TEST_USE_CPP=no + c90: CFLAGS=-Werror -Wall -std=c90 -Wno-error=strict-aliasing + c99: TEST_USE_CPP=no + c99: CFLAGS=-Werror -Wall -std=c99 -Wno-error=strict-aliasing + cpp: TEST_USE_CPP=yes + cpp: CFLAGS=-Werror -Wall -Wno-error=strict-aliasing From d7ec71fba392ca4cbd7b7f266f21e0e3526996ec Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 7 Jan 2021 16:53:54 +0100 Subject: [PATCH 02/11] Replace Travis CI by GitHub Actions --- .github/workflows/main.yml | 32 ++++++++++++++++++++++++++++++++ .travis.yml | 33 --------------------------------- 2 files changed, 32 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/main.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..2b997fe --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,32 @@ +on: + push: + branches: + - master + - ci-test + pull_request: + branches: + - master + +name: Run Tox tests + +jobs: + tox_test: + name: Tox test + steps: + - uses: actions/checkout@v2 + - name: Run Tox tests + id: test + uses: fedora-python/tox-github-action@master + with: + tox_env: ${{ matrix.tox_env }} + dnf_install: /usr/bin/make + strategy: + matrix: + tox_env: [ + py27-c90, py35-c90, py36-c90, + py27-c99, py35-c99, py36-c99, py37-c99, py38-c99, py39-c99, py310-c99, + py27-c90, py35-cpp, py36-cpp, py37-cpp, py38-cpp, py39-cpp, py310-cpp, + ] + + # Use GitHub's Linux Docker host + runs-on: ubuntu-latest diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 63c3b23..0000000 --- a/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -language: python -arch: - - amd64 - - ppc64le -python: - - "2.7" - - "3.4" - - "3.5" - - "3.5" - - "3.6" - - "3.7" - - "3.8" - - "3.9" - - "nightly" - -env: - - TEST_USE_CPP=no CFLAGS="-Werror -Wall -std=c90 -Wno-error=strict-aliasing" - - TEST_USE_CPP=no CFLAGS="-Werror -Wall -std=c99 -Wno-error=strict-aliasing" - - TEST_USE_CPP=yes CFLAGS="-Werror -Wall -Wno-error=strict-aliasing" - -matrix: - exclude: - # CPython 3.8+ won't compile with c90. - - python: "3.8" - env: TEST_USE_CPP=no CFLAGS="-Werror -Wall -std=c90 -Wno-error=strict-aliasing" - - python: "3.9" - env: TEST_USE_CPP=no CFLAGS="-Werror -Wall -std=c90 -Wno-error=strict-aliasing" - - python: "nightly" - env: TEST_USE_CPP=no CFLAGS="-Werror -Wall -std=c90 -Wno-error=strict-aliasing" - -script: make test-python - -sudo: false From f5d56bbceac5e18b0af79247cbbb7a19bd1c8309 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 7 Jan 2021 18:24:41 +0100 Subject: [PATCH 03/11] Add py34 to CI --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2b997fe..4597403 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,9 +23,9 @@ jobs: strategy: matrix: tox_env: [ - py27-c90, py35-c90, py36-c90, - py27-c99, py35-c99, py36-c99, py37-c99, py38-c99, py39-c99, py310-c99, - py27-c90, py35-cpp, py36-cpp, py37-cpp, py38-cpp, py39-cpp, py310-cpp, + py27-c90, py34-c90, py35-c90, py36-c90, + py27-c99, py34-c90, py35-c99, py36-c99, py37-c99, py38-c99, py39-c99, py310-c99, + py27-c90, py34-c90, py35-cpp, py36-cpp, py37-cpp, py38-cpp, py39-cpp, py310-cpp, ] # Use GitHub's Linux Docker host From 5c0fdb51c0b089c3103f6270916f295e40e950a3 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 7 Jan 2021 18:25:00 +0100 Subject: [PATCH 04/11] Don't limit branches for pull_request --- .github/workflows/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4597403..abe7d3a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,8 +4,6 @@ on: - master - ci-test pull_request: - branches: - - master name: Run Tox tests From f4b43dec6932f68b46e43d00d5d5eb45aeb761bd Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 7 Jan 2021 18:27:34 +0100 Subject: [PATCH 05/11] Don't install make explicitly --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index abe7d3a..6c36fac 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,6 @@ jobs: uses: fedora-python/tox-github-action@master with: tox_env: ${{ matrix.tox_env }} - dnf_install: /usr/bin/make strategy: matrix: tox_env: [ From f391c51e44ec3aa6a43bb298ac442c24f805e759 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 7 Jan 2021 18:27:43 +0100 Subject: [PATCH 06/11] Fix Tox environments --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6c36fac..b37d962 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,8 +21,8 @@ jobs: matrix: tox_env: [ py27-c90, py34-c90, py35-c90, py36-c90, - py27-c99, py34-c90, py35-c99, py36-c99, py37-c99, py38-c99, py39-c99, py310-c99, - py27-c90, py34-c90, py35-cpp, py36-cpp, py37-cpp, py38-cpp, py39-cpp, py310-cpp, + py27-c99, py34-c99, py35-c99, py36-c99, py37-c99, py38-c99, py39-c99, py310-c99, + py27-cpp, py34-cpp, py35-cpp, py36-cpp, py37-cpp, py38-cpp, py39-cpp, py310-cpp, ] # Use GitHub's Linux Docker host From 1420e38adc138fc0cd952aa6de138357923e8e98 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 7 Jan 2021 18:52:59 +0100 Subject: [PATCH 07/11] Allow parallel Tox runs --- Makefile | 12 ++++++++---- tox.ini | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 4b04f7c..93a375b 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,9 @@ includedir ?= $(prefix)/include datarootdir ?= $(prefix)/share datadir ?= $(datarootdir) pkgconfigdir ?= ${datadir}/pkgconfig +testbuilddir ?= test/build + +_testbuilddir_abs=$(abspath ${testbuilddir}) doc: cd doc && $(MAKE) html @@ -24,16 +27,17 @@ test: # TODO: A better way to build & use one-off extensions? build-%: - cd test; rm -rvf build ; $* setup.py build + cd test; rm -rvf ${_testbuilddir_abs} ; $* setup.py build -b ${_testbuilddir_abs} build-%-cpp: - cd test; rm -rvf build ; TEST_USE_CPP=yes $* setup.py build + cd test; rm -rvf ${_testbuilddir_abs} ; TEST_USE_CPP=yes $* setup.py build -b ${_testbuilddir_abs} test-%: build-% - PYTHONPATH=$(wildcard test/build/lib*) $* test -v + echo ${_testbuilddir_abs} + PYTHONPATH=$(wildcard ${_testbuilddir_abs}/lib*) $* test -v test-%-cpp: build-%-cpp - TEST_USE_CPP=yes PYTHONPATH=$(wildcard test/build/lib*) $* test -v + TEST_USE_CPP=yes PYTHONPATH=$(wildcard ${_testbuilddir_abs}/lib*) $* test -v $(includedir): mkdir -p $(includedir) diff --git a/tox.ini b/tox.ini index 75cbd23..4b2e270 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ skipsdist = True [testenv] allowlist_externals = make -commands = make test-python +commands = make testbuilddir={envdir}/build test-python setenv= c90: TEST_USE_CPP=no c90: CFLAGS=-Werror -Wall -std=c90 -Wno-error=strict-aliasing From ab2c19299eda2ad124181eda89f7540c0730e0a3 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 7 Jan 2021 18:56:52 +0100 Subject: [PATCH 08/11] Remove Python 3.4 from CI --- .github/workflows/main.yml | 6 +++--- doc/source/changelog.rst | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b37d962..059c1c3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,9 +20,9 @@ jobs: strategy: matrix: tox_env: [ - py27-c90, py34-c90, py35-c90, py36-c90, - py27-c99, py34-c99, py35-c99, py36-c99, py37-c99, py38-c99, py39-c99, py310-c99, - py27-cpp, py34-cpp, py35-cpp, py36-cpp, py37-cpp, py38-cpp, py39-cpp, py310-cpp, + py27-c90, py35-c90, py36-c90, + py27-c99, py35-c99, py36-c99, py37-c99, py38-c99, py39-c99, py310-c99, + py27-cpp, py35-cpp, py36-cpp, py37-cpp, py38-cpp, py39-cpp, py310-cpp, ] # Use GitHub's Linux Docker host diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst index 8cef472..54533ae 100644 --- a/doc/source/changelog.rst +++ b/doc/source/changelog.rst @@ -7,6 +7,11 @@ py3c Changes Version History =============== +v1.4 (upcoming) + +* CI no longer tests with Python 3.4 + + v1.3.1 (2021-01-07) ----------------- From a777028bb29ce2148f7eed69dbe2bed29838daa8 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 7 Jan 2021 19:35:21 +0100 Subject: [PATCH 09/11] Bring Travis CI back for Python 3.4 --- .travis.yml | 15 +++++++++++++++ doc/source/changelog.rst | 4 ---- 2 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..0ca02a1 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,15 @@ +language: python +arch: + - amd64 + - ppc64le +python: + - "3.4" + +env: + - TEST_USE_CPP=no CFLAGS="-Werror -Wall -std=c90 -Wno-error=strict-aliasing" + - TEST_USE_CPP=no CFLAGS="-Werror -Wall -std=c99 -Wno-error=strict-aliasing" + - TEST_USE_CPP=yes CFLAGS="-Werror -Wall -Wno-error=strict-aliasing" + +script: make test-python + +sudo: false diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst index 54533ae..f4387ae 100644 --- a/doc/source/changelog.rst +++ b/doc/source/changelog.rst @@ -7,10 +7,6 @@ py3c Changes Version History =============== -v1.4 (upcoming) - -* CI no longer tests with Python 3.4 - v1.3.1 (2021-01-07) ----------------- From 81a00b0664b532cc33817ed84940ac9ba4d2b60d Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 7 Jan 2021 19:37:53 +0100 Subject: [PATCH 10/11] Remove special-case "ci-test" branch --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 059c1c3..c59d507 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,6 @@ on: push: branches: - master - - ci-test pull_request: name: Run Tox tests From a4cc55e14029e778b87ea8591dbbb8976d302133 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 7 Jan 2021 19:59:16 +0100 Subject: [PATCH 11/11] Run Python 3.3 tests in the python:3.3 container from Docker Hub --- .github/workflows/main.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c59d507..fffd508 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,3 +26,19 @@ jobs: # Use GitHub's Linux Docker host runs-on: ubuntu-latest + + py33-test: + name: Python 3.3 test + container: python:3.3 + steps: + - uses: actions/checkout@v2 + - name: Run tests + env: + CFLAGS: "-Werror -Wall -Wno-error=strict-aliasing" + run: | + CFLAGS="$CFLAGS -std=c90" make test-python + CFLAGS="$CFLAGS -std=c99" make test-python + make test-python-cpp + + # Use GitHub's Linux Docker host + runs-on: ubuntu-latest