diff --git a/babelizer/errors.py b/babelizer/errors.py index 8a06edb..edf1abd 100644 --- a/babelizer/errors.py +++ b/babelizer/errors.py @@ -1,13 +1,15 @@ """Exceptions raised by the *babelizer*.""" +from __future__ import annotations + class BabelizeError(Exception): """An exception that the babelizer can handle and show to the user.""" - def __init__(self, message): + def __init__(self, message: str): self._message = message - def __str__(self): + def __str__(self) -> str: """Render a user-readable error message.""" return self._message diff --git a/babelizer/utils.py b/babelizer/utils.py index c32f51d..eaa6dc4 100644 --- a/babelizer/utils.py +++ b/babelizer/utils.py @@ -1,8 +1,11 @@ """Utility functions used by the babelizer.""" +from __future__ import annotations + import pathlib import subprocess import sys +from collections.abc import Iterator from contextlib import contextmanager from contextlib import suppress @@ -36,7 +39,7 @@ def setup_py(*args): return [sys.executable, "setup.py"] + list(args) -def get_setup_py_version(): +def get_setup_py_version() -> str | None: """Get babelized package version. Returns @@ -64,7 +67,7 @@ def get_setup_py_version(): @contextmanager -def save_files(files): +def save_files(files: Iterator[str]): """Generate repository files through a context. Parameters