diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 80aa38235..9d52b3964 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,7 @@ repos: args: [--markdown-linebreak-ext=md] - repo: https://github.com/ambv/black - rev: 22.12.0 + rev: 23.1.0 hooks: - id: black name: Blacken diff --git a/demo/vertical/define_ontology.py b/demo/vertical/define_ontology.py index d13acbbc1..3770d4e66 100755 --- a/demo/vertical/define_ontology.py +++ b/demo/vertical/define_ontology.py @@ -52,7 +52,6 @@ # Add new classes and object/data properties needed by the use case with onto: - # # Relations # ========= diff --git a/ontopy/graph.py b/ontopy/graph.py index 5a6302d21..ec142243a 100644 --- a/ontopy/graph.py +++ b/ontopy/graph.py @@ -479,7 +479,6 @@ def add_edge(self, subject, predicate, obj, edgelabel=None, **attrs): raise RuntimeError(f'`object` "{obj}" must have been added') key = (subject, predicate, obj) if key not in self.edges: - if edgelabel is None: edgelabel = self.edgelabels @@ -531,7 +530,6 @@ def add_source_edges( # pylint: disable=too-many-arguments,too-many-branches entity = self.ontology[source] if isinstance(source, str) else source label = get_label(entity) for relation in entity.is_a: - # isA if isinstance( relation, (owlready2.ThingClass, owlready2.ObjectPropertyClass) diff --git a/ontopy/ontology.py b/ontopy/ontology.py index 77028aa6b..90eed6c08 100644 --- a/ontopy/ontology.py +++ b/ontopy/ontology.py @@ -1131,7 +1131,6 @@ class docstrings are mapped to. Defaults to "comment". if not hasattr(cls, "prefLabel"): # no prefLabel - create new annotation property.. with self: - # pylint: disable=invalid-name,missing-class-docstring # pylint: disable=unused-variable class prefLabel(owlready2.label): diff --git a/requirements_dev.txt b/requirements_dev.txt index e963c4cde..368511e28 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,4 +1,5 @@ -pre-commit~=2.21 +pre-commit>=2.21.0,<3; python_version<"3.8" +pre-commit~=3.0; python_version>="3.8" pylint~=2.15 pytest~=7.2 pytest-cov~=4.0 diff --git a/tests/test_basic.py b/tests/test_basic.py index 81a1f8315..1be4e8eb0 100755 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -30,7 +30,6 @@ def test_basic(emmo: "Ontology") -> None: onto.new_entity("Hydr ogen", emmo.Atom) with onto: - # Add entity using python classes class Oxygen(emmo.Atom): """Oxygen atom.""" diff --git a/tests/test_catalog.py b/tests/test_catalog.py index 5be3e4aa3..c5d2fc600 100644 --- a/tests/test_catalog.py +++ b/tests/test_catalog.py @@ -7,7 +7,6 @@ def test_catalog(repo_dir: "Path", tmpdir: "Path") -> None: - ontodir = repo_dir / "tests" / "catalogs_for_testing" catalog_expected = { "http://emmo.info/testonto/0.1.0": str(ontodir / "testonto.ttl"), diff --git a/tools/ontoconvert b/tools/ontoconvert index 1dae42466..7b308b1eb 100755 --- a/tools/ontoconvert +++ b/tools/ontoconvert @@ -270,7 +270,6 @@ def main(argv: list = None): graph2.serialize(destination=args.output, format=fmt) else: - onto.save( args.output, format=output_format,