From 1d58acabeabb0ab2e6fdadf3a83173981b661ec3 Mon Sep 17 00:00:00 2001 From: Giacomo Marchioro Date: Fri, 14 Jul 2023 15:01:55 +0200 Subject: [PATCH 1/3] Create python-package.yml --- .github/workflows/python-package.yml | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/python-package.yml diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 0000000..b926e17 --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,40 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python package + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install orjson + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with unittest + run: | + python -m unittest discover -s tests/ From 5095021444d3498fda7f39b1821f7773dcb68c34 Mon Sep 17 00:00:00 2001 From: Giacomo Marchioro Date: Fri, 14 Jul 2023 15:38:04 +0200 Subject: [PATCH 2/3] Update python-package.yml --- .github/workflows/python-package.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index b926e17..823ff50 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -28,6 +28,7 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install orjson + python -m pip install flake8 if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 run: | From 8be0bb67c578ac49218c4ec8a6789c283327f538 Mon Sep 17 00:00:00 2001 From: Giacomo Marchioro Date: Mon, 17 Jul 2023 17:30:15 +0200 Subject: [PATCH 3/3] Fix typos README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f03db1e..fa14521 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Development : ## Basic usage The module maps the API structure to Python classes. The user `set_` objects that can have only one value (e.g. `id`) and `add_` objects that can have multiple entities (e.g. `labels`). -As an example, we will execute the [Simple Manifest - Book recipe](https://iiif.io/api/cookbook/recipe/0009-book-1/) from the IIIF cookbook. More examples from the [cookbook](https://iiif.io/api/cookbook/) in the examples folder of this repository. +As an example, we will execute the [Simple Manifest - Book recipe](https://iiif.io/api/cookbook/recipe/0009-book-1/) from the IIIF cookbook. More examples from the [cookbook](https://iiif.io/api/cookbook/) are in the examples folder of this repository. ```python from IIIFpres import iiifpapi3 @@ -59,7 +59,7 @@ manifest.json_save("manifest.json") ``` ## Debug the manifest -When you are populating a new IIIF type from scratch some helpful function can be +When you are populating a new IIIF type from scratch some helpful functions can be used for spotting errors. `.inspect()` method returns a JSON representation of the object where the @@ -71,7 +71,7 @@ manifest = iiifpapi3.Manifest() manifest.inspect() ``` -`.show_errors_in_browser()` method open a new browser tab highlighting the +`.show_errors_in_browser()` method opens a new browser tab highlighting the required and recommended fields. ```python @@ -79,7 +79,7 @@ manifest.show_errors_in_browser() ``` ## Reading the manifest (experimental) -A json file compliant with presentation API3 can be read as follow: +A JSON file compliant with presentation API3 can be read as follows: ```python from IIIFpres.utilities import read_API3_json mymanifest = read_API3_json('manifest.json') @@ -95,4 +95,4 @@ The package is provided by the [Laboratorio di Studi Medievali e Danteschi](http LaMeDan Logo -Bisides contributors, I would like to thank [dnoneill](https://github.com/dnoneill) for suggestions , and IIIF community and coordinators. +Besides contributors, I would like to thank [dnoneill](https://github.com/dnoneill) for suggestions, and IIIF community and coordinators.