Skip to content

Commit

Permalink
Merge branch 'master' into add-figures-to-generated-documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
francescalb authored Jun 21, 2024
2 parents f96665b + 1524490 commit 61bca18
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 15 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/ci_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 1 addition & 0 deletions ontopy/excelparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions ontopy/ontology.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tools/excel2onto
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 "
Expand Down

0 comments on commit 61bca18

Please sign in to comment.