From a6e1c3379d596feebe21f8834c06745f87743ffc Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 9 Jan 2024 21:31:03 +0100 Subject: [PATCH 01/12] GitHub Actions: python: ["3.8", "3.9", "3.10", "3.11", "3.12"] --- .github/workflows/python-tox.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/python-tox.yml b/.github/workflows/python-tox.yml index cfcc42e6..e66397fe 100644 --- a/.github/workflows/python-tox.yml +++ b/.github/workflows/python-tox.yml @@ -7,30 +7,29 @@ jobs: strategy: fail-fast: false matrix: - # 2.7, 3.5, and 3.6 run on Windows via AppVeyor - python: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python: ["3.8", "3.9", "3.10", "3.11", "3.12"] os: [ubuntu-latest, windows-latest] deps: [base, optional] include: - python: "pypy-2.7" os: ubuntu-latest deps: base - - python: "pypy-3.8" + - python: "pypy-3.10" os: ubuntu-latest deps: base - python: "2.7" os: ubuntu-latest deps: oldest - - python: "3.7" + - python: "3.8" os: ubuntu-latest deps: oldest runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - if: ${{ matrix.deps == 'base' }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} cache: pip @@ -38,7 +37,7 @@ jobs: requirements.txt requirements-test.txt - if: ${{ matrix.deps == 'optional' }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} cache: pip @@ -47,7 +46,7 @@ jobs: requirements-optional.txt requirements-test.txt - if: ${{ matrix.deps == 'oldest' }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} cache: pip From 21e2f2f5b4ecd87125041b0447d9151062c3bc98 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 9 Jan 2024 21:41:45 +0100 Subject: [PATCH 02/12] python: "2.7" on os: ubuntu-20.04 ? --- .github/workflows/python-tox.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-tox.yml b/.github/workflows/python-tox.yml index e66397fe..69ec0ef7 100644 --- a/.github/workflows/python-tox.yml +++ b/.github/workflows/python-tox.yml @@ -18,7 +18,7 @@ jobs: os: ubuntu-latest deps: base - python: "2.7" - os: ubuntu-latest + os: ubuntu-20.04 deps: oldest - python: "3.8" os: ubuntu-latest From 27e2a2bf0bdfa7bf80266caff6e75a923ed2d25b Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 9 Jan 2024 21:44:11 +0100 Subject: [PATCH 03/12] requirements-test.txt: pytest>=5.4.2,<7.4.0 ; python_version >= '3' --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 27866e59..5e018322 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -3,7 +3,7 @@ flake8==3.9.2 ; python_version < '3.6' flake8>=5.0.4; python_version >= '3.6' pytest>=4.6.10,<5 ; python_version < '3' -pytest>=5.4.2,<7 ; python_version >= '3' +pytest>=5.4.2,<7.4.0 ; python_version >= '3' coverage>=5.1,<6 pytest-expect>=1.1.0,<2 mock>=3.0.5,<4 ; python_version < '3.6' From 057bfe15c72c220d1cf30f683f37ce53eb257e17 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 9 Jan 2024 21:49:04 +0100 Subject: [PATCH 04/12] requirements-test.txt: pytest>=5.4.2,<8 ; python_version >= '3' --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 5e018322..9000754c 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -3,7 +3,7 @@ flake8==3.9.2 ; python_version < '3.6' flake8>=5.0.4; python_version >= '3.6' pytest>=4.6.10,<5 ; python_version < '3' -pytest>=5.4.2,<7.4.0 ; python_version >= '3' +pytest>=5.4.2,<8 ; python_version >= '3' coverage>=5.1,<6 pytest-expect>=1.1.0,<2 mock>=3.0.5,<4 ; python_version < '3.6' From 917c0624f2340a584b489c58606ba3c2c25b883f Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 9 Jan 2024 21:50:32 +0100 Subject: [PATCH 05/12] python: "2.7" on os: windows-latest ? --- .github/workflows/python-tox.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-tox.yml b/.github/workflows/python-tox.yml index 69ec0ef7..f2ef37d9 100644 --- a/.github/workflows/python-tox.yml +++ b/.github/workflows/python-tox.yml @@ -18,7 +18,7 @@ jobs: os: ubuntu-latest deps: base - python: "2.7" - os: ubuntu-20.04 + os: windows-latest deps: oldest - python: "3.8" os: ubuntu-latest From f7fc1e20e5739bdcee58343b4b30beb2381ca566 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 9 Jan 2024 21:59:22 +0100 Subject: [PATCH 06/12] Implement the test changes from #570 --- html5lib/tests/tokenizer.py | 2 +- html5lib/tests/tree_construction.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/html5lib/tests/tokenizer.py b/html5lib/tests/tokenizer.py index cc9897a4..6bbf19b5 100644 --- a/html5lib/tests/tokenizer.py +++ b/html5lib/tests/tokenizer.py @@ -246,7 +246,7 @@ def runtest(self): def repr_failure(self, excinfo): traceback = excinfo.traceback ntraceback = traceback.cut(path=__file__) - excinfo.traceback = ntraceback.filter() + excinfo.traceback = ntraceback.filter(excinfo) return excinfo.getrepr(funcargs=True, showlocals=False, diff --git a/html5lib/tests/tree_construction.py b/html5lib/tests/tree_construction.py index fb0657bf..ff1ce967 100644 --- a/html5lib/tests/tree_construction.py +++ b/html5lib/tests/tree_construction.py @@ -135,7 +135,7 @@ def runtest(self): def repr_failure(self, excinfo): traceback = excinfo.traceback ntraceback = traceback.cut(path=__file__) - excinfo.traceback = ntraceback.filter() + excinfo.traceback = ntraceback.filter(excinfo) return excinfo.getrepr(funcargs=True, showlocals=False, From 12a51e456ea62a8d0460d61999c707475f0e865a Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 9 Jan 2024 22:00:32 +0100 Subject: [PATCH 07/12] GitHub Actions refuses to run legacy Python --- .github/workflows/python-tox.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/python-tox.yml b/.github/workflows/python-tox.yml index f2ef37d9..73d67011 100644 --- a/.github/workflows/python-tox.yml +++ b/.github/workflows/python-tox.yml @@ -17,9 +17,6 @@ jobs: - python: "pypy-3.10" os: ubuntu-latest deps: base - - python: "2.7" - os: windows-latest - deps: oldest - python: "3.8" os: ubuntu-latest deps: oldest From d30e69ab1c0b01b7709750085bc1038fb2195d5e Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 9 Jan 2024 22:11:02 +0100 Subject: [PATCH 08/12] Implement the test changes from #573 --- html5lib/tests/tokenizer.py | 3 ++- html5lib/tests/tree_construction.py | 3 ++- requirements-test.txt | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/html5lib/tests/tokenizer.py b/html5lib/tests/tokenizer.py index 6bbf19b5..add77b4c 100644 --- a/html5lib/tests/tokenizer.py +++ b/html5lib/tests/tokenizer.py @@ -246,7 +246,8 @@ def runtest(self): def repr_failure(self, excinfo): traceback = excinfo.traceback ntraceback = traceback.cut(path=__file__) - excinfo.traceback = ntraceback.filter(excinfo) + filter_args = (excinfo,) if pytest.version_tuple >= (7, 4, 0) else () + excinfo.traceback = ntraceback.filter(*filter_args) return excinfo.getrepr(funcargs=True, showlocals=False, diff --git a/html5lib/tests/tree_construction.py b/html5lib/tests/tree_construction.py index ff1ce967..589f39a3 100644 --- a/html5lib/tests/tree_construction.py +++ b/html5lib/tests/tree_construction.py @@ -135,7 +135,8 @@ def runtest(self): def repr_failure(self, excinfo): traceback = excinfo.traceback ntraceback = traceback.cut(path=__file__) - excinfo.traceback = ntraceback.filter(excinfo) + filter_args = (excinfo,) if pytest.version_tuple >= (7, 4, 0) else () + excinfo.traceback = ntraceback.filter(*filter_args) return excinfo.getrepr(funcargs=True, showlocals=False, diff --git a/requirements-test.txt b/requirements-test.txt index 9000754c..39913ee4 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -8,3 +8,4 @@ coverage>=5.1,<6 pytest-expect>=1.1.0,<2 mock>=3.0.5,<4 ; python_version < '3.6' mock>=4.0.2,<5 ; python_version >= '3.6' +setuptools; python_version >= '3.12' From 6bcbf1cdaf228fac48ac632c2ff5cd91353191f3 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 9 Jan 2024 22:17:29 +0100 Subject: [PATCH 09/12] pytest_ver = pytest.getattr("version_tuple", ()) --- html5lib/tests/tokenizer.py | 3 ++- html5lib/tests/tree_construction.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/html5lib/tests/tokenizer.py b/html5lib/tests/tokenizer.py index add77b4c..8a4cf354 100644 --- a/html5lib/tests/tokenizer.py +++ b/html5lib/tests/tokenizer.py @@ -246,7 +246,8 @@ def runtest(self): def repr_failure(self, excinfo): traceback = excinfo.traceback ntraceback = traceback.cut(path=__file__) - filter_args = (excinfo,) if pytest.version_tuple >= (7, 4, 0) else () + pytest_ver = pytest.getattr("version_tuple", ()) + filter_args = (excinfo,) if pytest_ver >= (7, 4, 0) else () excinfo.traceback = ntraceback.filter(*filter_args) return excinfo.getrepr(funcargs=True, diff --git a/html5lib/tests/tree_construction.py b/html5lib/tests/tree_construction.py index 589f39a3..39ff1568 100644 --- a/html5lib/tests/tree_construction.py +++ b/html5lib/tests/tree_construction.py @@ -135,7 +135,8 @@ def runtest(self): def repr_failure(self, excinfo): traceback = excinfo.traceback ntraceback = traceback.cut(path=__file__) - filter_args = (excinfo,) if pytest.version_tuple >= (7, 4, 0) else () + pytest_ver = pytest.getattr("version_tuple", ()) + filter_args = (excinfo,) if pytest_ver >= (7, 4, 0) else () excinfo.traceback = ntraceback.filter(*filter_args) return excinfo.getrepr(funcargs=True, From a546ca3a5e699602a563a99d974534580ac09303 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 9 Jan 2024 22:19:40 +0100 Subject: [PATCH 10/12] pytest_ver = getattr(pytest, "version_tuple", ()) --- html5lib/tests/tokenizer.py | 2 +- html5lib/tests/tree_construction.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/html5lib/tests/tokenizer.py b/html5lib/tests/tokenizer.py index 8a4cf354..b49d2e6e 100644 --- a/html5lib/tests/tokenizer.py +++ b/html5lib/tests/tokenizer.py @@ -246,7 +246,7 @@ def runtest(self): def repr_failure(self, excinfo): traceback = excinfo.traceback ntraceback = traceback.cut(path=__file__) - pytest_ver = pytest.getattr("version_tuple", ()) + pytest_ver = getattr(pytest, "version_tuple", ()) filter_args = (excinfo,) if pytest_ver >= (7, 4, 0) else () excinfo.traceback = ntraceback.filter(*filter_args) diff --git a/html5lib/tests/tree_construction.py b/html5lib/tests/tree_construction.py index 39ff1568..363b48c2 100644 --- a/html5lib/tests/tree_construction.py +++ b/html5lib/tests/tree_construction.py @@ -135,7 +135,7 @@ def runtest(self): def repr_failure(self, excinfo): traceback = excinfo.traceback ntraceback = traceback.cut(path=__file__) - pytest_ver = pytest.getattr("version_tuple", ()) + pytest_ver = getattr(pytest, "version_tuple", ()) filter_args = (excinfo,) if pytest_ver >= (7, 4, 0) else () excinfo.traceback = ntraceback.filter(*filter_args) From 1a0fff339227bdea86072d65c148f6a23df71221 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 9 Jan 2024 23:31:49 +0100 Subject: [PATCH 11/12] AppVeyor: Python 2.7 and 3.7 from #576 --- .appveyor.yml | 27 +++++++++++++++++---------- .github/workflows/python-tox.yml | 1 + 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 7661aa63..93088fcc 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,23 +1,30 @@ +# appveyor.yml - https://www.appveyor.com/docs/lang/python +# https://www.appveyor.com/docs/windows-images-software/#visual-studio-2019 +# https://www.appveyor.com/docs/windows-images-software/#visual-studio-2022 +--- image: Visual Studio 2019 environment: - global: - PATH: "C:\\Python27\\Scripts\\;%PATH%" matrix: - - TOXENV: py27-base - - TOXENV: py27-optional - - TOXENV: py35-base - - TOXENV: py35-optional - - TOXENV: py36-base - - TOXENV: py36-optional + - PY_PYTHON: 2.7 + TOXENV: py27-base + - PY_PYTHON: 2.7 + TOXENV: py27-optional + - PY_PYTHON: 3.7 + TOXENV: py37-base + - PY_PYTHON: 3.7 + TOXENV: py37-optional install: - git submodule update --init --recursive - - python -m pip install tox + - py --list + - py -VV + - py -m pip install --upgrade pip + - py -m pip install tox build: off test_script: - - tox + - py -m tox after_test: - python debug-info.py diff --git a/.github/workflows/python-tox.yml b/.github/workflows/python-tox.yml index 73d67011..5ed83175 100644 --- a/.github/workflows/python-tox.yml +++ b/.github/workflows/python-tox.yml @@ -7,6 +7,7 @@ jobs: strategy: fail-fast: false matrix: + # 2.7 and 3.7 run on Windows via AppVeyor python: ["3.8", "3.9", "3.10", "3.11", "3.12"] os: [ubuntu-latest, windows-latest] deps: [base, optional] From c76be32028a02730441ece0bb3deebc1c70602c3 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 9 Jan 2024 23:44:05 +0100 Subject: [PATCH 12/12] AppVeyor: Python 2.7 and 3.7 from #576 --- .appveyor.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 93088fcc..e6f7bf48 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,8 +1,7 @@ # appveyor.yml - https://www.appveyor.com/docs/lang/python -# https://www.appveyor.com/docs/windows-images-software/#visual-studio-2019 # https://www.appveyor.com/docs/windows-images-software/#visual-studio-2022 --- -image: Visual Studio 2019 +image: Visual Studio 2022 environment: matrix: - PY_PYTHON: 2.7 @@ -27,4 +26,4 @@ test_script: - py -m tox after_test: - - python debug-info.py + - py debug-info.py