Skip to content

Commit b2fb7f4

Browse files
committed
Strict typing
1 parent ac99273 commit b2fb7f4

5 files changed

Lines changed: 6 additions & 7 deletions

File tree

src/bioontologies/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
@click.group()
3131
@click.version_option()
32-
def main():
32+
def main() -> None:
3333
"""CLI for bioontologies."""
3434

3535

@@ -42,7 +42,7 @@ def main():
4242
is_flag=True,
4343
help="Save intermediate OBO Graph JSON file if conversion from OWL is required",
4444
)
45-
def index(prefix: str, graph_id: str | None, directory: Path | None, save_obograph: bool):
45+
def index(prefix: str, graph_id: str | None, directory: Path | None, save_obograph: bool) -> None:
4646
"""Generate a node index file."""
4747
from .robot import get_obograph_by_prefix
4848

src/bioontologies/ner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def get_literal_mappings_subset(
9797
ancestors: curies.Reference | Sequence[curies.Reference],
9898
*,
9999
check: bool = False,
100-
**kwargs,
100+
**kwargs: Any,
101101
) -> list[ssslm.LiteralMapping]:
102102
"""Get a subset of literal mappings for terms under the ancestors."""
103103
if isinstance(ancestors, curies.Reference):

src/bioontologies/relations/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def get_curie_to_norm_name() -> Mapping[str, str]:
111111
HEADER = ["prefix", "identifier", "label", "synonyms"]
112112

113113

114-
def main():
114+
def main() -> None:
115115
"""Download and process the relation ontology data."""
116116
from bioontologies import get_obograph_by_prefix
117117
from bioontologies.obograph import GraphDocument

src/bioontologies/upgrade/import_debio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
OBO_PURL = "http://purl.obolibrary.org/obo/"
99

1010

11-
def main():
11+
def main() -> None:
1212
"""Import rewrites from DeBiO."""
1313
for node in requests.get(URL, timeout=5).json()["graphs"][0]["nodes"]:
1414
if node.get("type") != "PROPERTY":

tox.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ deps =
115115
mypy
116116
pydantic
117117
types-requests
118-
skip_install = true
119-
commands = mypy --install-types --non-interactive --ignore-missing-imports src/
118+
commands = mypy --ignore-missing-imports --strict src/
120119

121120
[testenv:doc8]
122121
skip_install = true

0 commit comments

Comments
 (0)