From 1524490becf01aedf3dd3d7af23bd7c253225177 Mon Sep 17 00:00:00 2001 From: "TEAM 4.0[bot]" Date: Fri, 21 Jun 2024 23:32:11 +0200 Subject: [PATCH] [Auto-generated] Update dependencies (#770) ### Update dependencies Automatically created PR from [`ci/dependabot-updates`](https://github.com/emmo-repo/EMMOntoPy/tree/ci/dependabot-updates). The PR is based on the ['CI - Update dependencies PR' workflow](https://SINTEF.github.io/ci-cd/latest/workflows/ci_update_dependencies/) in [SINTEF/ci-cd](https://github.com/SINTEF/ci-cd). #### To do - [ ] Check that the diff is sensible, and that tests and builds pass with the new dependency versions. - [ ] Make sure that the PR is **squash** merged, with a sensible commit message. --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Francesca L. Bleken <48128015+francescalb@users.noreply.github.com> Co-authored-by: francescalb Co-authored-by: Jesper Friis --- .github/workflows/ci_workflow.yml | 19 +++++++++++-------- .pre-commit-config.yaml | 2 +- ontopy/excelparser.py | 1 + ontopy/ontology.py | 6 +++--- requirements.txt | 2 +- requirements_dev.txt | 2 +- tools/excel2onto | 2 +- 7 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index 7ed2a9890..435f55a73 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -26,19 +26,22 @@ jobs: pylint_options: "--rcfile=pyproject.toml" pylint_targets: "*.py tools emmopy ontopy" - # safety - # Ignore ID 44715 for now. - # See this NumPy issue for more information: https://github.com/numpy/numpy/issues/19038 - # Also ignore IDs 44716 and 44717 as they are not deemed to be as severe as it is - # laid out in the CVE. - # Remove ignoring 48547 as soon as RDFLib/rdflib#1844 has been fixed and the fix - # has been released. + + # safety-specific settings run_safety: true + # 48547: RDFLib vulnerability: https://pyup.io/vulnerabilities/PVE-2022-48547/48547/ + # 44715-44717: NumPy vulnerabilities: + # https://pyup.io/vulnerabilities/CVE-2021-41495/44715/ + # https://pyup.io/vulnerabilities/CVE-2021-41496/44716/ + # https://pyup.io/vulnerabilities/CVE-2021-34141/44717/ + # 70612: Jinja2 vulnerability. Only used as subdependency for mkdocs++ in tripper. + # https://data.safetycli.com/v/70612/97c/ safety_options: | + --ignore=48547 --ignore=44715 --ignore=44716 --ignore=44717 - --ignore=48547 + --ignore=70612 # Build distribution run_build_package: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8d02b5ef8..40817eabf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: name: Blacken - repo: https://github.com/PyCQA/bandit - rev: '1.7.8' + rev: '1.7.9' hooks: - id: bandit args: [-r] diff --git a/ontopy/excelparser.py b/ontopy/excelparser.py index 34504ad66..2b7a8762d 100755 --- a/ontopy/excelparser.py +++ b/ontopy/excelparser.py @@ -643,6 +643,7 @@ def _add_entities( if not altlabel == "nan": labels.update(altlabel.split(";")) # Find column name depending on entitytype + rowheader = "entity_type_not_set" if entitytype is owlready2.ThingClass: rowheader = "subClassOf" # If entitytype is a subclass of owlready2.PropertyClass diff --git a/ontopy/ontology.py b/ontopy/ontology.py index c1952c535..d9731b8e9 100644 --- a/ontopy/ontology.py +++ b/ontopy/ontology.py @@ -1112,16 +1112,16 @@ def get_imported_ontologies(self, recursive=False): are also returned. """ - def rec_imported(onto): + def rec_imported(onto, imported): for ontology in onto.imported_ontologies: # pylint: disable=possibly-used-before-assignment if ontology not in imported: imported.add(ontology) - rec_imported(ontology) + rec_imported(ontology, imported) if recursive: imported = set() - rec_imported(self) + rec_imported(self, imported) return list(imported) return self.imported_ontologies diff --git a/requirements.txt b/requirements.txt index 8980a005c..0d97d1d20 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ blessings>=1.7,<2 Cython>=0.29.21,<3.1 defusedxml>=0.7.1,<1 graphviz>=0.16,<0.21 -numpy>=1.19.5,<2 +numpy>=1.19.5,<3 openpyxl>=3.0.9,<3.2 Owlready2>=0.28,!=0.32,!=0.34,<0.44 packaging>=21.0,<25 diff --git a/requirements_dev.txt b/requirements_dev.txt index a8fdb47f1..c278c9e39 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,7 +1,7 @@ pre-commit>=2.21.0,<3; python_version<"3.9" pre-commit~=3.7; python_version>="3.9" pylint~=2.17; python_version<"3.8" -pylint~=3.1; python_version>="3.8" +pylint~=3.2; python_version>="3.8" pytest~=7.4; python_version<"3.8" pytest~=8.2; python_version>="3.8" pytest-cov~=4.1; python_version<"3.8" diff --git a/tools/excel2onto b/tools/excel2onto index 8b144d1a1..a86e68c89 100755 --- a/tools/excel2onto +++ b/tools/excel2onto @@ -71,6 +71,7 @@ def main(argv: list = None): except SystemExit as exc: sys.exit(exc.code) # Exit without traceback on invalid arguments + input_ontology = None if args.update: try: if args.input_ontology: @@ -83,7 +84,6 @@ def main(argv: list = None): "Did not find the output ontology to be updated, " "will fully generate a new one." ) - input_ontology = None else: raise FileNotFoundError( "The output ontology to be updated "