diff --git a/.github/workflows/daily-test.yml b/.github/workflows/daily-test.yml index ae77b81b5..70f3bb316 100644 --- a/.github/workflows/daily-test.yml +++ b/.github/workflows/daily-test.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout source - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 1 - name: Set up JDK 17 @@ -19,7 +19,7 @@ jobs: distribution: "temurin" java-version: "17" - name: Set up Python 3.9 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.9 - name: Install dependencies diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 561a53bca..ae2c6d151 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,12 +17,12 @@ jobs: runs-on: ubuntu-latest steps: # check out repo - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 1 # install python - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: '3.9' # install python dependencies diff --git a/.github/workflows/tests-on-push.yml b/.github/workflows/tests-on-push.yml index 7c722138f..b8008f212 100644 --- a/.github/workflows/tests-on-push.yml +++ b/.github/workflows/tests-on-push.yml @@ -14,7 +14,7 @@ jobs: target: [ 'test-end-to-end-ci', 'test-unittests', 'docs-build' ] steps: - name: Checkout source - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 1 - name: Set up JDK 17 @@ -23,7 +23,7 @@ jobs: distribution: "temurin" java-version: "17" - name: Set up Python 3.9 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.9 - name: Install dependencies diff --git a/knora/dsplib/utils/xml_upload.py b/knora/dsplib/utils/xml_upload.py index 6b69db839..f0654f1d9 100644 --- a/knora/dsplib/utils/xml_upload.py +++ b/knora/dsplib/utils/xml_upload.py @@ -240,7 +240,7 @@ def _check_consistency_with_ontology( """ if verbose: print("Check if the resource types and properties are consistent with the ontology...") - knora_properties = resclass_name_2_type[resources[0].restype].knora_properties + knora_properties = resclass_name_2_type[resources[0].restype].knora_properties # type: ignore for resource in resources: @@ -259,7 +259,7 @@ def _check_consistency_with_ontology( ) # check that the property types are consistent with the ontology - resource_properties = resclass_name_2_type[resource.restype].properties.keys() + resource_properties = resclass_name_2_type[resource.restype].properties.keys() # type: ignore for propname in [prop.name for prop in resource.properties]: if propname not in knora_properties and propname not in resource_properties: raise BaseError( @@ -471,7 +471,7 @@ def _upload_resources( if resource.bitstream: try: img: Optional[dict[Any, Any]] = try_network_action( - action=lambda: sipi_server.upload_bitstream(filepath=os.path.join(imgdir, resource.bitstream.value)), + action=lambda: sipi_server.upload_bitstream(filepath=os.path.join(imgdir, resource.bitstream.value)), # type: ignore failure_msg=f'ERROR while trying to upload file "{resource.bitstream.value}" of resource ' f'"{resource.label}" ({resource.id}).' ) @@ -481,7 +481,7 @@ def _upload_resources( continue bitstream_size_uploaded_mb += next(bitstream_all_sizes_iterator) print(f"Uploaded file '{resource.bitstream.value}' ({bitstream_size_uploaded_mb:.1f} MB / {bitstream_size_total_mb} MB)") - internal_file_name_bitstream = img['uploadedFiles'][0]['internalFilename'] + internal_file_name_bitstream = img['uploadedFiles'][0]['internalFilename'] # type: ignore resource_bitstream = resource.get_bitstream(internal_file_name_bitstream, permissions_lookup) # create the resource in DSP @@ -493,7 +493,7 @@ def _upload_resources( con=con, label=resource.label, iri=resource_iri, - permissions=permissions_lookup.get(resource.permissions), + permissions=permissions_lookup.get(resource.permissions), # type: ignore creation_date=resource.creation_date, bitstream=resource_bitstream, values=properties diff --git a/test/e2e/test_tools.py b/test/e2e/test_tools.py index ccbb9480e..a0f58c735 100644 --- a/test/e2e/test_tools.py +++ b/test/e2e/test_tools.py @@ -13,6 +13,7 @@ import jsonpath_ng import jsonpath_ng.ext +import pytest from knora.dsplib.utils.excel_to_json_lists import excel2lists, validate_lists_section_with_schema from knora.dsplib.utils.excel_to_json_project import excel2json @@ -336,7 +337,7 @@ def test_id_to_iri(self) -> None: self.assertTrue(os.path.isfile("testdata/tmp/test-id2iri-out.xml")) os.remove("testdata/tmp/test-id2iri-out.xml") - + @pytest.mark.filterwarnings("ignore") def test_excel2xml(self) -> None: excel2xml("testdata/excel2xml-testdata.xlsx", "1234", "excel2xml-output") self.assertTrue(os.path.isfile("excel2xml-output-data.xml"))