Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typing for app_context #109

Merged
merged 2 commits into from
Oct 15, 2023
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: 2 additions & 0 deletions changelogs/fragments/109-typing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "Fix typing for ``antsibull_core.app_context.app_context()`` functions (https://github.com/ansible-community/antsibull-core/pull/109)."
8 changes: 3 additions & 5 deletions src/antsibull_core/app_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def run(args):
import contextvars
import typing as t
from collections.abc import Iterable, Mapping
from contextlib import contextmanager
from contextlib import AbstractContextManager, contextmanager

from .schemas.context import AppContext, LibContext
from .vendored.collections import ImmutableDict
Expand Down Expand Up @@ -368,14 +368,12 @@ def lib_context(


@t.overload
@contextmanager
def app_context() -> t.ContextManager[AppContext]:
def app_context() -> AbstractContextManager[AppContext]:
...


@t.overload
@contextmanager
def app_context(new_context: AppContextT) -> t.ContextManager[AppContextT]:
def app_context(new_context: AppContextT) -> AbstractContextManager[AppContextT]:
...


Expand Down