diff --git a/.github/workflows/cd_publish.yml b/.github/workflows/cd_publish.yml index fe675a707..da04e4a6e 100644 --- a/.github/workflows/cd_publish.yml +++ b/.github/workflows/cd_publish.yml @@ -7,7 +7,7 @@ on: jobs: publish: name: External - uses: SINTEF/ci-cd/.github/workflows/cd_release.yml@v2.7.4 + uses: SINTEF/ci-cd/.github/workflows/cd_release.yml@v2.8.2 if: github.repository == 'emmo-repo/EMMOntoPy' && startsWith(github.ref, 'refs/tags/v') with: git_username: EMMOntoPy Developers @@ -31,5 +31,4 @@ jobs: changelog_exclude_labels: dependencies secrets: - PyPI_token: ${{ secrets.PYPI_TOKEN }} PAT: ${{ secrets.RELEASE_PAT }} diff --git a/.github/workflows/ci_automerge_dependabot.yml b/.github/workflows/ci_automerge_dependabot.yml index 69faf0bb6..60a4de915 100644 --- a/.github/workflows/ci_automerge_dependabot.yml +++ b/.github/workflows/ci_automerge_dependabot.yml @@ -7,7 +7,7 @@ on: jobs: update-dependabot-branch: name: External - uses: SINTEF/ci-cd/.github/workflows/ci_automerge_prs.yml@v2.7.4 + uses: SINTEF/ci-cd/.github/workflows/ci_automerge_prs.yml@v2.8.2 if: github.repository_owner == 'emmo-repo' && startsWith(github.event.pull_request.head.ref, 'dependabot/') && github.actor == 'dependabot[bot]' secrets: PAT: ${{ secrets.RELEASE_PAT }} diff --git a/.github/workflows/ci_cd_updated_master.yml b/.github/workflows/ci_cd_updated_master.yml index ba58a14d5..32bdd8b11 100644 --- a/.github/workflows/ci_cd_updated_master.yml +++ b/.github/workflows/ci_cd_updated_master.yml @@ -7,7 +7,7 @@ on: jobs: updates-to-master: name: External - uses: SINTEF/ci-cd/.github/workflows/ci_cd_updated_default_branch.yml@v2.7.4 + uses: SINTEF/ci-cd/.github/workflows/ci_cd_updated_default_branch.yml@v2.8.2 if: github.repository_owner == 'emmo-repo' with: git_username: EMMOntoPy Developers diff --git a/.github/workflows/ci_dependabot.yml b/.github/workflows/ci_dependabot.yml index 3b9e53dd8..612289651 100644 --- a/.github/workflows/ci_dependabot.yml +++ b/.github/workflows/ci_dependabot.yml @@ -11,7 +11,7 @@ on: jobs: create-collected-pr: name: External - uses: SINTEF/ci-cd/.github/workflows/ci_update_dependencies.yml@v2.7.4 + uses: SINTEF/ci-cd/.github/workflows/ci_update_dependencies.yml@v2.8.2 if: github.repository_owner == 'emmo-repo' with: git_username: EMMOntoPy Developers diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index 435f55a73..17927d22b 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -10,7 +10,7 @@ on: jobs: tests: name: External - uses: SINTEF/ci-cd/.github/workflows/ci_tests.yml@v2.7.4 + uses: SINTEF/ci-cd/.github/workflows/ci_tests.yml@v2.8.2 with: # General install_extras: "[dev,docs]" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 40817eabf..0fdf6860a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: check-symlinks - id: check-xml @@ -17,13 +17,13 @@ repos: args: [--markdown-linebreak-ext=md] - repo: https://github.com/ambv/black - rev: 24.4.2 + rev: 24.10.0 hooks: - id: black name: Blacken - repo: https://github.com/PyCQA/bandit - rev: '1.7.9' + rev: '1.7.10' hooks: - id: bandit args: [-r] @@ -36,7 +36,7 @@ repos: # exclude: ^tests/.*$ - repo: https://github.com/SINTEF/ci-cd - rev: v2.7.4 + rev: v2.8.3 hooks: - id: docs-api-reference args: diff --git a/ontopy/excelparser.py b/ontopy/excelparser.py index 2b7a8762d..a537a286e 100755 --- a/ontopy/excelparser.py +++ b/ontopy/excelparser.py @@ -34,6 +34,7 @@ class ExcelError(EMMOntoPyException): def create_ontology_from_excel( # pylint: disable=too-many-arguments, too-many-locals excelpath: str, + *, concept_sheet_name: str = "Concepts", metadata_sheet_name: str = "Metadata", imports_sheet_name: str = "ImportedOntologies", @@ -290,7 +291,7 @@ def _relative_to_absolute_paths(path): ) -def create_ontology_from_pandas( # pylint:disable=too-many-locals,too-many-branches,too-many-statements,too-many-arguments +def create_ontology_from_pandas( # pylint:disable=too-many-locals,too-many-branches,too-many-statements,too-many-arguments, too-many-positional-arguments data: pd.DataFrame, objectproperties: pd.DataFrame, annotationproperties: pd.DataFrame, @@ -585,6 +586,7 @@ def _add_literal( # pylint: disable=too-many-arguments data: Union[pd.DataFrame, pd.Series], destination: owlready2.prop.IndividualValueList, # name: str, + *, metadata: bool = False, only_one: bool = False, sep: str = ";", @@ -903,7 +905,7 @@ def _add_range_domain( return onto, properties_with_errors -def _make_entity_list( # pylint: disable=too-many-arguments +def _make_entity_list( # pylint: disable=too-many-arguments, too-many-positional-arguments onto: owlready2.Ontology, row: pd.Series, rowheader: str, diff --git a/ontopy/graph.py b/ontopy/graph.py index 7b7ac7f05..672120db0 100644 --- a/ontopy/graph.py +++ b/ontopy/graph.py @@ -239,6 +239,7 @@ def __init__( # pylint: disable=too-many-arguments,too-many-locals self, ontology, root=None, + *, leaves=None, entities=None, relations="isA", @@ -296,7 +297,7 @@ def __init__( # pylint: disable=too-many-arguments,too-many-locals elif root: self.add_branch( root, - leaves, + leaves=leaves, relations=relations, edgelabels=edgelabels, addnodes=addnodes, @@ -326,6 +327,7 @@ def __init__( # pylint: disable=too-many-arguments,too-many-locals def add_entities( # pylint: disable=too-many-arguments self, entities=None, + *, relations="isA", edgelabels=None, addnodes=False, @@ -353,6 +355,7 @@ def add_entities( # pylint: disable=too-many-arguments def add_branch( # pylint: disable=too-many-arguments,too-many-locals self, root, + *, leaves=None, include_leaves=True, strict_leaves=False, @@ -427,6 +430,7 @@ def add_branch( # pylint: disable=too-many-arguments,too-many-locals def add_parents( # pylint: disable=too-many-arguments self, name, + *, levels=1, relations="isA", edgelabels=None, @@ -522,6 +526,7 @@ def add_edge(self, subject, predicate, obj, edgelabel=None, **attrs): def add_source_edges( # pylint: disable=too-many-arguments,too-many-branches self, source, + *, relations=None, edgelabels=None, addnodes=None, @@ -607,6 +612,7 @@ def add_source_edges( # pylint: disable=too-many-arguments,too-many-branches def add_edges( # pylint: disable=too-many-arguments self, + *, sources=None, relations=None, edgelabels=None, @@ -998,6 +1004,7 @@ def setmodules(onto): def plot_modules( # pylint: disable=too-many-arguments src, filename=None, + *, fmt=None, show=False, strip_base=None, diff --git a/ontopy/ontodoc.py b/ontopy/ontodoc.py index 872565c8e..387ab983b 100644 --- a/ontopy/ontodoc.py +++ b/ontopy/ontodoc.py @@ -597,6 +597,7 @@ def __init__( # pylint: disable=too-many-arguments template, ontodoc, basedir=".", + *, figdir="genfigs", figformat="png", figscale=1.0, @@ -756,7 +757,7 @@ def process_branches(self): branch, int(opts.header_level) # pylint: disable=no-member ).split("\n") - def _make_branchfig( # pylint: disable=too-many-arguments,too-many-locals + def _make_branchfig( # pylint: disable=too-many-arguments,too-many-locals, too-many-positional-arguments self, name: str, path: "Union[Path, str]", @@ -1142,6 +1143,7 @@ def process(self): def write( # pylint: disable=too-many-arguments self, outfile, + *, fmt=None, pandoc_option_files=(), pandoc_options=(), @@ -1288,6 +1290,7 @@ def run_pandoc( # pylint: disable=too-many-arguments genfile, outfile, fmt, + *, pandoc_option_files=(), pandoc_options=(), verbose=True, @@ -1444,6 +1447,7 @@ def get_maxwidth(fmt): def get_docpp( # pylint: disable=too-many-arguments ontodoc, infile, + *, figdir="genfigs", figformat="png", maxwidth=None, diff --git a/ontopy/ontology.py b/ontopy/ontology.py index d9731b8e9..c14682a70 100644 --- a/ontopy/ontology.py +++ b/ontopy/ontology.py @@ -311,6 +311,7 @@ def set_default_label_annotations(self): def get_by_label( self, label: str, + *, label_annotations: str = None, prefix: str = None, imported: bool = True, @@ -586,6 +587,7 @@ def set_common_prefix( def load( # pylint: disable=too-many-arguments,arguments-renamed self, + *, only_local=False, filename=None, format=None, # pylint: disable=redefined-builtin @@ -677,6 +679,7 @@ def load( # pylint: disable=too-many-arguments,arguments-renamed def _load( # pylint: disable=too-many-arguments,too-many-locals,too-many-branches,too-many-statements self, + *, only_local=False, filename=None, format=None, # pylint: disable=redefined-builtin @@ -864,6 +867,7 @@ def save( filename=None, format=None, dir=".", + *, mkdir=False, overwrite=False, recursive=False, @@ -1128,6 +1132,7 @@ def rec_imported(onto, imported): def get_entities( # pylint: disable=too-many-arguments self, + *, imported=True, classes=True, individuals=True, @@ -1537,6 +1542,7 @@ def get_branch( # pylint: disable=too-many-arguments root, leaves=(), include_leaves=True, + *, strict_leaves=False, exclude=None, sort=False, diff --git a/ontopy/utils.py b/ontopy/utils.py index fdd73ff61..44f92d1f0 100644 --- a/ontopy/utils.py +++ b/ontopy/utils.py @@ -342,6 +342,7 @@ class ReadCatalogError(IOError): def read_catalog( # pylint: disable=too-many-locals,too-many-statements,too-many-arguments uri, + *, catalog_file="catalog-v001.xml", baseuri=None, recursive=False, @@ -602,6 +603,7 @@ def _validate_installed_version( def convert_imported( # pylint: disable=too-many-arguments,too-many-locals input_ontology: "Union[Path, str]", output_ontology: "Union[Path, str]", + *, input_format: "Optional[str]" = None, output_format: str = "xml", url_from_catalog: "Optional[bool]" = None, diff --git a/requirements_dev.txt b/requirements_dev.txt index 3390bdb8c..e789bdf72 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,5 +1,5 @@ pre-commit>=2.21.0,<3; python_version<"3.9" -pre-commit~=3.7; python_version>="3.9" +pre-commit~=3.8; python_version>="3.9" pylint~=2.17; python_version<"3.8" pylint~=3.2; python_version>="3.8" pytest~=7.4; python_version<"3.8" diff --git a/requirements_docs.txt b/requirements_docs.txt index 48a2c3b5a..80e18f894 100644 --- a/requirements_docs.txt +++ b/requirements_docs.txt @@ -4,5 +4,5 @@ mkdocs~=1.6; python_version>="3.8" mkdocs-awesome-pages-plugin~=2.9 mkdocs-material~=9.5; python_version>="3.8" mkdocs-material~=9.2; python_version<"3.8" -mkdocstrings[python-legacy]~=0.25.1; python_version>="3.8" +mkdocstrings[python-legacy]~=0.26.1; python_version>="3.8" mkdocstrings[python-legacy]~=0.22.0; python_version<"3.8"