From 777e6a2b63db5880e9a83e35434317d4ce1f4dc2 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Thu, 18 Dec 2025 22:49:17 +0000 Subject: [PATCH 01/10] Update iiif_3_0.json Simplifying choice --- schema/iiif_3_0.json | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/schema/iiif_3_0.json b/schema/iiif_3_0.json index 0b8cded..b58dc8c 100644 --- a/schema/iiif_3_0.json +++ b/schema/iiif_3_0.json @@ -156,10 +156,14 @@ "properties":{ "type": { "type": "string", - "const": "Choice" + "const": "Choice", + "default": "Choice" }, "items":{ - "type": "array" + "type": "array", + "items": { + "$ref": "#/classes/resource" + } } }, "required": ["type", "items"] @@ -987,23 +991,12 @@ }, { "type": "object", - "allOf":[ - { "$ref": "#/classes/choice" }, - { - "properties": { - "items": { - "type": "array", - "items": {"$ref": "#/classes/resource"} - } - }, - "required": ["items"] - } - ] + "$ref": "#/classes/choice" }, { "type": "array", "items": { - "type": "object" + "$ref": "#/classes/resource" } } From 3f68458eb75806c1af713c1c7e85304cce1cdb36 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Thu, 18 Dec 2025 22:51:12 +0000 Subject: [PATCH 02/10] Dropping 3.9 support --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 58aedf5..a421f83 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.9', '3.10', '3.11'] + python-version: [ '3.10', '3.11'] name: Python ${{ matrix.python-version }} sample steps: - uses: actions/checkout@v4 From e3734a849a60915c60254125c6da17ca20ecbcd2 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Thu, 18 Dec 2025 22:51:41 +0000 Subject: [PATCH 03/10] Dropping 3.9 support --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index ab2b0b7..02c6a30 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,6 @@ def run(self): "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Topic :: Internet :: WWW/HTTP", From eb0d1fc1d394cdc774a6a378be05587356e2bf8b Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Thu, 18 Dec 2025 22:55:33 +0000 Subject: [PATCH 04/10] Moving away from setup.py test --- .github/workflows/test.yml | 2 +- setup.py | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a421f83..90dbe7c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,7 +33,7 @@ jobs: run: python setup.py install - name: Test - run: python setup.py test + run: python -m unittest discover -s tests -p "test*.py" - name: install coveralls run: pip install coveralls diff --git a/setup.py b/setup.py index 02c6a30..8efe554 100644 --- a/setup.py +++ b/setup.py @@ -53,11 +53,6 @@ def run(self): extras_require={ ':python_version>="3.6"': ["Pillow>=3.2.0"] }, - test_suite="tests", - tests_require=[ - "coverage", - "mock", - ], cmdclass={ 'coverage': Coverage, }, From a9f1f20122c41be374ff1bdd89beb14ec7cd96eb Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Thu, 18 Dec 2025 23:05:40 +0000 Subject: [PATCH 05/10] Moving to tox for testing --- .github/workflows/test.yml | 10 +++------- tests/test_validator.py | 2 +- tox.ini | 6 ++++++ 3 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 tox.ini diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 90dbe7c..d9906c4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.10', '3.11'] + python-version: [ '3.10', '3.11', '3.12', '3.13'] name: Python ${{ matrix.python-version }} sample steps: - uses: actions/checkout@v4 @@ -26,19 +26,15 @@ jobs: path: ${{ env.pythonLocation }} key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('dev-requirements.txt') }} - - name: Install setup tools - run: pip install setuptools - - name: Install - run: python setup.py install + run: python -m pip install -U tox - name: Test - run: python -m unittest discover -s tests -p "test*.py" + run: tox - name: install coveralls run: pip install coveralls - - name: Generate coverage run: coverage run --include=iiif-presentation-validator.py setup.py test diff --git a/tests/test_validator.py b/tests/test_validator.py index 6cb5c90..1369ea1 100644 --- a/tests/test_validator.py +++ b/tests/test_validator.py @@ -1,6 +1,6 @@ """Test code for iiif-presentation-validator.py.""" import unittest -from mock import Mock +from unittest.mock import Mock try: import imp except ImportError: diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..ab6d726 --- /dev/null +++ b/tox.ini @@ -0,0 +1,6 @@ +[tox] +envlist = py311 + +[testenv] +commands = + python -m unittest discover -s tests -p "test*.py" From da3c077e804578e0fbbc433f86b750f2ae5cf84f Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Thu, 18 Dec 2025 23:07:03 +0000 Subject: [PATCH 06/10] Removing hard coded version --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index ab6d726..6962a4c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py311 +envlist = py [testenv] commands = From 3ec13aaa2cd67f2820197b885cb443af89b187b6 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Thu, 18 Dec 2025 23:18:22 +0000 Subject: [PATCH 07/10] Updating coveralls --- .github/workflows/test.yml | 45 ++++++++++++++++++++------------------ tox.ini | 6 ++++- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d9906c4..8cd59cb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,33 +26,36 @@ jobs: path: ${{ env.pythonLocation }} key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('dev-requirements.txt') }} - - name: Install + - name: Install tox run: python -m pip install -U tox - name: Test run: tox - - name: install coveralls - run: pip install coveralls - - - name: Generate coverage - run: coverage run --include=iiif-presentation-validator.py setup.py test - - - name: Upload coverage data to coveralls.io - run: coveralls --service=github - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_FLAG_NAME: ${{ matrix.python-version }} - COVERALLS_PARALLEL: true + - name: Upload coverage to Coveralls + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + format: cobertura + file: coverage.xml + flag-name: ${{ matrix.python-version }} + parallel: true - Coveralls: + coveralls-finish: needs: build runs-on: ubuntu-latest - container: python:3-slim + if: ${{ always() }} steps: - - name: Coveralls Finished - run: | - pip3 install --upgrade coveralls - coveralls --service=github --finish - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Finish Coveralls parallel build + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel-finished: true + - name: Upload coverage to Coveralls + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + format: cobertura + file: coverage.xml + flag-name: ${{ matrix.python-version }} + parallel: true diff --git a/tox.ini b/tox.ini index 6962a4c..42e7b59 100644 --- a/tox.ini +++ b/tox.ini @@ -2,5 +2,9 @@ envlist = py [testenv] +deps = + coverage commands = - python -m unittest discover -s tests -p "test*.py" + coverage run -m unittest discover -s tests -p "test*.py" + coverage xml + coverage report -m From 0e8e55935a61e72c7e6019c4c70468ee80d1c7da Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Thu, 18 Dec 2025 23:25:16 +0000 Subject: [PATCH 08/10] Fixing coveralls --- .github/workflows/test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8cd59cb..fc5b534 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,7 +55,5 @@ jobs: uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.GITHUB_TOKEN }} - format: cobertura - file: coverage.xml flag-name: ${{ matrix.python-version }} parallel: true From b66c935104aa2e4f760bffded7d20d5091595947 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Thu, 18 Dec 2025 23:29:30 +0000 Subject: [PATCH 09/10] More coveralls --- .github/workflows/test.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fc5b534..ab29592 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,7 +40,7 @@ jobs: file: coverage.xml flag-name: ${{ matrix.python-version }} parallel: true - + coveralls-finish: needs: build runs-on: ubuntu-latest @@ -51,9 +51,4 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} parallel-finished: true - - name: Upload coverage to Coveralls - uses: coverallsapp/github-action@v2 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - flag-name: ${{ matrix.python-version }} - parallel: true + From 50dcfc2536fe8895d4a3f6f3a29dbc3bac569a40 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Thu, 18 Dec 2025 23:31:01 +0000 Subject: [PATCH 10/10] Updating python versions --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index 8efe554..b1578c0 100644 --- a/setup.py +++ b/setup.py @@ -35,6 +35,8 @@ def run(self): "Programming Language :: Python", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Internet :: WWW/HTTP", "Topic :: Multimedia :: Graphics :: Graphics Conversion", "Topic :: Software Development :: "