Skip to content

Commit

Permalink
Reexport signals (#680)
Browse files Browse the repository at this point in the history
Co-authored-by: Sam Bull <git@sambull.org>
  • Loading branch information
blast-hardcheese and Dreamsorcerer authored Oct 29, 2024
1 parent aedc58a commit 7761648
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ jobs:
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
- name: Checkout
uses: actions/checkout@v4
- name: Upload coverage
uses: aio-libs/upload-coverage@v24.10.0

Expand Down
12 changes: 8 additions & 4 deletions janus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@
from heapq import heappop, heappush
from queue import Empty as SyncQueueEmpty
from queue import Full as SyncQueueFull
from typing import Any, Callable, Deque, Generic, List, Optional, Protocol, Set, TypeVar
from typing import Any, Callable, Generic, Optional, Protocol, TypeVar

__version__ = "1.0.0"
__all__ = (
"Queue",
"PriorityQueue",
"LifoQueue",
"SyncQueue",
"SyncQueueEmpty",
"SyncQueueFull",
"AsyncQueue",
"AsyncQueueEmpty",
"AsyncQueueFull",
"BaseQueue",
)

Expand Down Expand Up @@ -103,7 +107,7 @@ def __init__(self, maxsize: int = 0) -> None:
self._finished.set()

self._closing = False
self._pending = set() # type: Set[asyncio.Future[Any]]
self._pending: set[asyncio.Future[Any]] = set()

def checked_call_soon_threadsafe(
callback: Callable[..., None], *args: Any
Expand Down Expand Up @@ -169,7 +173,7 @@ def async_q(self) -> "_AsyncQueueProxy[T]":
# These will only be called with appropriate locks held

def _init(self, maxsize: int) -> None:
self._queue = deque() # type: Deque[T]
self._queue: deque[T] = deque()

def _qsize(self) -> int:
return len(self._queue)
Expand Down Expand Up @@ -593,7 +597,7 @@ class PriorityQueue(Queue[T]):
"""

def _init(self, maxsize: int) -> None:
self._heap_queue = [] # type: List[T]
self._heap_queue: list[T] = []

def _qsize(self) -> int:
return len(self._heap_queue)
Expand Down
1 change: 0 additions & 1 deletion tests/test_mixed.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import asyncio
import contextlib
import sys
import threading

import pytest
Expand Down

0 comments on commit 7761648

Please sign in to comment.