diff --git a/docs/conf.py b/docs/conf.py index 30ac574..b5a286c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -7,12 +7,13 @@ import sys from datetime import date from mondolib import __version__ + # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information -project = 'mondolib' +project = "mondolib" copyright = f"{date.today().year}, Chris Mungall " -author = 'Chris Mungall ' +author = "Chris Mungall " release = __version__ # -- General configuration --------------------------------------------------- @@ -24,7 +25,7 @@ "sphinx_rtd_theme", "sphinx_click", "sphinx_autodoc_typehints", - "myst_parser" + "myst_parser", ] # generate autosummary pages @@ -45,13 +46,13 @@ # This pattern also affects html_static_path and html_extra_path. exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] -templates_path = ['_templates'] +templates_path = ["_templates"] # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output -html_theme = 'sphinx_rtd_theme' -html_static_path = ['_static'] +html_theme = "sphinx_rtd_theme" +html_static_path = ["_static"] # The name of an image file (relative to this directory) to place at the top # of the sidebar. diff --git a/pyproject.toml b/pyproject.toml index 86b09ac..2dc88f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ line-length = 120 target-version = ["py38", "py39", "py310"] [tool.ruff] -extend-ignore = [ +lint.extend-ignore = [ "D211", # `no-blank-line-before-class` "D212", # `multi-line-summary-first-line` "B005", # Using `.strip()` with multi-character strings is misleading the reader @@ -50,10 +50,10 @@ exclude = [ line-length = 120 # Allow autofix for all enabled rules (when `--fix`) is provided. -fixable = ["ALL"] +lint.fixable = ["ALL"] # Select or ignore from https://beta.ruff.rs/docs/rules/ -select = [ +lint.select = [ "B", # bugbear "D", # pydocstyle "E", # pycodestyle errors @@ -63,10 +63,10 @@ select = [ "W", # Warning ] -unfixable = [] +lint.unfixable = [] target-version = "py310" -[tool.ruff.mccabe] +[tool.ruff.lint.mccabe] # Unlike Flake8, default to a complexity level of 10. max-complexity = 10 diff --git a/src/mondolib/__init__.py b/src/mondolib/__init__.py index b6ae6ce..e7fa905 100644 --- a/src/mondolib/__init__.py +++ b/src/mondolib/__init__.py @@ -1,4 +1,5 @@ """mondolib package.""" + import importlib_metadata try: diff --git a/src/mondolib/cli.py b/src/mondolib/cli.py index a6b7e54..1942fe6 100644 --- a/src/mondolib/cli.py +++ b/src/mondolib/cli.py @@ -1,4 +1,5 @@ """Command line interface for mondolib.""" + import logging import click diff --git a/src/mondolib/constants.py b/src/mondolib/constants.py index 28c2baa..fd069c0 100644 --- a/src/mondolib/constants.py +++ b/src/mondolib/constants.py @@ -1,4 +1,5 @@ """Constants used in package.""" + from pathlib import Path ONT_DIR = Path(__file__).resolve().parents[1] / "ontology" diff --git a/src/mondolib/datamodels/mondolib_schema.py b/src/mondolib/datamodels/mondolib_schema.py index 40ffb8b..14b3f69 100644 --- a/src/mondolib/datamodels/mondolib_schema.py +++ b/src/mondolib/datamodels/mondolib_schema.py @@ -1,4 +1,5 @@ """Autogenerated Schema file.""" + # Auto generated from mondolib_schema.yaml by pythongen.py version: 0.9.0 # Generation date: 2022-06-10T11:39:26 # Schema: mondolib_schema @@ -44,7 +45,6 @@ class CandidateObsoletionTerm(extended_str): @dataclass class LexicalPattern(YAMLRoot): - """A lexical pattern that is matched against labels.""" _inherited_slots: ClassVar[List[str]] = [] @@ -119,9 +119,9 @@ class CandidateObsoletion(YAMLRoot): label: Optional[str] = None confidence: Optional[float] = None is_ordo_only: Optional[Union[bool, Bool]] = None - lexical_pattern_matches: Optional[ - Union[Union[dict, LexicalPattern], List[Union[dict, LexicalPattern]]] - ] = empty_list() + lexical_pattern_matches: Optional[Union[Union[dict, LexicalPattern], List[Union[dict, LexicalPattern]]]] = ( + empty_list() + ) direct_child_terms: Optional[Union[str, List[str]]] = empty_list() is_likely_grouping: Optional[Union[bool, Bool]] = None has_definition: Optional[Union[bool, Bool]] = None @@ -164,7 +164,6 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): @dataclass class Report(YAMLRoot): - """A pan-ontology report. This focuses on bespoke Mondo checks rather than generic OBO checks.""" _inherited_slots: ClassVar[List[str]] = [] @@ -191,7 +190,6 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): # Enumerations class ValidationCheckScope(EnumDefinitionImpl): - """Some validations are only performed in particular contexts or scopes.""" ORDO_ONLY = PermissibleValue( diff --git a/src/mondolib/datamodels/vocabulary.py b/src/mondolib/datamodels/vocabulary.py index 7abaed6..42089a7 100644 --- a/src/mondolib/datamodels/vocabulary.py +++ b/src/mondolib/datamodels/vocabulary.py @@ -1,2 +1,3 @@ """mondolib datamodel vocabularies.""" + ORPHANET_PREFIX = "Orphanet" diff --git a/src/mondolib/main.py b/src/mondolib/main.py index b08f3fc..391ba77 100644 --- a/src/mondolib/main.py +++ b/src/mondolib/main.py @@ -1,4 +1,5 @@ """Main python file.""" + import csv from typing import List, Tuple diff --git a/src/mondolib/qc/term_validator.py b/src/mondolib/qc/term_validator.py index 69a53ef..0ec5620 100644 --- a/src/mondolib/qc/term_validator.py +++ b/src/mondolib/qc/term_validator.py @@ -1,4 +1,5 @@ """mondolib term-validator.""" + import logging import os import re diff --git a/src/mondolib/utilities/curie_utilities.py b/src/mondolib/utilities/curie_utilities.py index e095500..5fc1695 100644 --- a/src/mondolib/utilities/curie_utilities.py +++ b/src/mondolib/utilities/curie_utilities.py @@ -1,4 +1,5 @@ """mondolib CURIE utilities.""" + from oaklib.types import CURIE diff --git a/tests/__init__.py b/tests/__init__.py index dad767d..f519298 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,4 +1,5 @@ """mondolib tests.""" + import os from pathlib import Path diff --git a/tests/test_qc/test_term_validator.py b/tests/test_qc/test_term_validator.py index 3f30194..cbc262c 100644 --- a/tests/test_qc/test_term_validator.py +++ b/tests/test_qc/test_term_validator.py @@ -1,4 +1,5 @@ """mondolib QC test: test validator.""" + import unittest from linkml_runtime.dumpers import yaml_dumper diff --git a/tox.ini b/tox.ini index c901c90..a95705d 100644 --- a/tox.ini +++ b/tox.ini @@ -49,7 +49,7 @@ deps = ruff skip_install = true commands = - black --check --diff src/ tests/ + ; black --check --diff src/ tests/ ruff check src/ tests/ description = Run linters.