Skip to content

Commit 12a9c28

Browse files
authored
Minor typing improvements (#482)
1 parent f0d6899 commit 12a9c28

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ dependencies = [
6868
"humanize",
6969
"tabulate",
7070
"cachier",
71-
"pystow>=0.7.5",
71+
"pystow<=0.7.23",
7272
"bioversions>=0.8.243",
7373
"bioregistry>=0.12.30",
7474
"ssslm>=0.0.13",

src/pyobo/cli/cli.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121

2222
@click.group()
2323
@click.version_option()
24-
def main():
24+
def main() -> None:
2525
"""CLI for PyOBO."""
2626

2727

2828
@main.command()
2929
@click.option("--remove-obo", is_flag=True)
30-
def clean(remove_obo: bool):
30+
def clean(remove_obo: bool) -> None:
3131
"""Delete all cached files."""
3232
suffixes = [
3333
"_mappings.tsv",
@@ -55,15 +55,15 @@ def clean(remove_obo: bool):
5555

5656

5757
@main.command()
58-
def ls():
58+
def ls() -> None:
5959
"""List how big all of the OBO files are."""
6060
import humanize
6161
from tabulate import tabulate
6262

63-
entries = [(prefix, os.path.getsize(path)) for prefix, path in _iter_cached_obo()]
63+
entries_init = [(prefix, os.path.getsize(path)) for prefix, path in _iter_cached_obo()]
6464
entries = [
6565
(prefix, humanize.naturalsize(size), "✅" if not has_nomenclature_plugin(prefix) else "❌")
66-
for prefix, size in sorted(entries, key=itemgetter(1), reverse=True)
66+
for prefix, size in sorted(entries_init, key=itemgetter(1), reverse=True)
6767
]
6868
click.echo(tabulate(entries, headers=["Source", "Size", "OBO"]))
6969

src/pyobo/cli/database.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040

4141
@click.group(name="database")
42-
def main():
42+
def main() -> None:
4343
"""Build the PyOBO Database."""
4444

4545

@@ -126,8 +126,7 @@ def build(ctx: click.Context, eager_versions: bool, **kwargs: Unpack[DatabaseKwa
126126
@database_annotate
127127
def cache(zenodo: bool, directory: Path, **kwargs: Unpack[DatabaseKwargs]) -> None:
128128
"""Cache all things."""
129-
from .database_utils import iter_helper_helper
130-
from ..getters import get_ontology
129+
from ..getters import get_ontology, iter_helper_helper
131130

132131
if zenodo:
133132
click.echo("no zenodo for caching")
@@ -144,9 +143,9 @@ def metadata(zenodo: bool, directory: Path, **kwargs: Unpack[DatabaseKwargs]) ->
144143
"""Make the prefix-metadata dump."""
145144
import bioregistry
146145

147-
from .database_utils import IterHelperHelperDict, iter_helper_helper
146+
from .database_utils import IterHelperHelperDict
148147
from ..api import get_metadata
149-
from ..getters import db_output_helper
148+
from ..getters import db_output_helper, iter_helper_helper
150149

151150
def _iter_metadata_internal(
152151
**kwargs: Unpack[IterHelperHelperDict],

src/pyobo/cli/lookup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333

3434
@click.group()
35-
def lookup():
35+
def lookup() -> None:
3636
"""Lookup resources."""
3737

3838

0 commit comments

Comments
 (0)