Skip to content

Commit

Permalink
fix: use creart EventLoop
Browse files Browse the repository at this point in the history
  • Loading branch information
RF-Tar-Railt committed Jan 3, 2025
1 parent 6648f37 commit 449429b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ jobs:
strategy:
matrix:
py_version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand Down
12 changes: 11 additions & 1 deletion launart/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,20 @@ def launch_blocking(
loop: asyncio.AbstractEventLoop | None = None,
stop_signal: Iterable[signal.Signals] = (signal.SIGINT,),
):
from creart import it
import contextlib
import threading

loop = asyncio.new_event_loop()
if loop is not None: # pragma: no cover
from warnings import warn

warn(
"The loop argument is deprecated since launart 0.6.4, " "and scheduled for removal in launart 0.7.0.",
DeprecationWarning,
stacklevel=2,
)

loop = it(asyncio.AbstractEventLoop)

logger.info("Starting launart main task...", style="green bold")

Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ profile = "black"
[tool.coverage.run]
branch = true
source = ["."]
omit = ["tests/*", "test.py"]
# omit = ["tests/*", "test.py"]
omit = ["test.py"] # TODO: fix tests/*

[tool.coverage.report]
# Regexes for lines to exclude from consideration
Expand Down

0 comments on commit 449429b

Please sign in to comment.