Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 21 additions & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

23 changes: 8 additions & 15 deletions schema/iiif_3_0.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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"
}
}

Expand Down
8 changes: 2 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 :: "
Expand All @@ -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,
},
Expand Down
2 changes: 1 addition & 1 deletion tests/test_validator.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
10 changes: 10 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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