diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 58aedf5..ab29592 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', '3.12', '3.13'] name: Python ${{ matrix.python-version }} sample steps: - uses: actions/checkout@v4 @@ -26,37 +26,29 @@ 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 + - name: Install tox + run: python -m pip install -U tox - name: Test - run: python setup.py test - - - name: install coveralls - run: pip install coveralls - - - - name: Generate coverage - run: coverage run --include=iiif-presentation-validator.py setup.py test + run: tox - - 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 - - Coveralls: + - 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-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 + 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" } } diff --git a/setup.py b/setup.py index ab2b0b7..b1578c0 100644 --- a/setup.py +++ b/setup.py @@ -33,9 +33,10 @@ 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", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Internet :: WWW/HTTP", "Topic :: Multimedia :: Graphics :: Graphics Conversion", "Topic :: Software Development :: " @@ -54,11 +55,6 @@ def run(self): extras_require={ ':python_version>="3.6"': ["Pillow>=3.2.0"] }, - test_suite="tests", - tests_require=[ - "coverage", - "mock", - ], cmdclass={ 'coverage': Coverage, }, 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..42e7b59 --- /dev/null +++ b/tox.ini @@ -0,0 +1,10 @@ +[tox] +envlist = py + +[testenv] +deps = + coverage +commands = + coverage run -m unittest discover -s tests -p "test*.py" + coverage xml + coverage report -m