Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/my/core/cachew.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def disable_cachew() -> None:


@contextmanager
def disabled_cachew() -> Generator[None, None, None]:
def disabled_cachew() -> Generator[None]:
try:
import cachew # noqa: F401 # unused, it's fine
except ImportError:
Expand Down
4 changes: 2 additions & 2 deletions src/my/core/cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def make_config[C](cls: type[C], migration: Callable[[Attrs], Attrs] = lambda x:


@contextmanager
def _override_config[F](config: F) -> Generator[F, None, None]:
def _override_config[F](config: F) -> Generator[F]:
'''
Temporary override for config's parameters, useful for testing/fake data/etc.
'''
Expand All @@ -52,7 +52,7 @@ def _override_config[F](config: F) -> Generator[F, None, None]:


@contextmanager
def _reload_modules(modules: ModuleRegex) -> Generator[None, None, None]:
def _reload_modules(modules: ModuleRegex) -> Generator[None]:
# need to use list here, otherwise reordering with set might mess things up
def loaded_modules() -> list[str]:
return [name for name in sys.modules if re.fullmatch(modules, name)]
Expand Down
2 changes: 1 addition & 1 deletion src/my/core/core_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def matches(specs: Sequence[str]) -> str | None:


@contextmanager
def _reset_config() -> Generator[Config, None, None]:
def _reset_config() -> Generator[Config]:
# todo maybe have this decorator for the whole of my.config?
from .cfg import _override_config

Expand Down
2 changes: 1 addition & 1 deletion src/my/core/konsume.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class UnconsumedError(Exception):

# TODO think about error policy later...
@contextmanager
def wrap(j, *, throw=True) -> Generator[Zoomable, None, None]:
def wrap(j, *, throw=True) -> Generator[Zoomable]:
w, children = _wrap(j)

yield w
Expand Down
2 changes: 1 addition & 1 deletion src/my/core/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def sqlite_connection(
immutable: bool = False,
row_factory: Factory | None = None,
_via_apsw: bool = False, # NOTE: experimental for now
) -> Generator[sqlite3.Connection, None, None]:
) -> Generator[sqlite3.Connection]:
uri = f'file:{db}'
# https://www.sqlite.org/draft/uri.html#uriimmutable
if immutable:
Expand Down
2 changes: 1 addition & 1 deletion src/my/core/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def match_structure(
expected: str | Sequence[str],
*,
partial: bool = False,
) -> Generator[tuple[Path, ...], None, None]:
) -> Generator[tuple[Path, ...]]:
"""
Given a 'base' directory or archive (zip/tar.gz), recursively search for one or more paths that match the
pattern described in 'expected'. That can be a single string, or a list
Expand Down
2 changes: 1 addition & 1 deletion src/my/core/tests/auto_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ def iter_data() -> Iterable[Item]:


@contextmanager
def some_contextmanager() -> Generator[str, None, None]:
def some_contextmanager() -> Generator[str]:
# this shouldn't end up in guess_stats because context manager is not a data provider
yield 'hello'
2 changes: 1 addition & 1 deletion src/my/core/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# TODO maybe move to hpi core?
@contextmanager
def tmp_environ_set(key: str, value: str | None) -> Generator[None, None, None]:
def tmp_environ_set(key: str, value: str | None) -> Generator[None]:
prev_value = os.environ.get(key)
if value is None:
os.environ.pop(key, None)
Expand Down
2 changes: 1 addition & 1 deletion src/my/fbmessenger/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class config(user_config.fbmessengerexport, Config):


@contextmanager
def _dal() -> Generator[messenger.DAL, None, None]:
def _dal() -> Generator[messenger.DAL]:
model = messenger.DAL(config.export_db)
with ExitStack() as stack:
if hasattr(model, '__dal__'): # defensive to support legacy fbmessengerexport
Expand Down
Loading