diff --git a/CHANGES.rst b/CHANGES.rst index 78dcee5..12e3174 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,11 @@ Changes ======= +1.0.0 (2021-12-17) +------------------ + +- Drop Python 3.6 support + 0.7.0 (2021-11-24) ------------------ diff --git a/janus/__init__.py b/janus/__init__.py index f21882e..a2887aa 100644 --- a/janus/__init__.py +++ b/janus/__init__.py @@ -11,7 +11,7 @@ from typing_extensions import Protocol -__version__ = "0.7.0" +__version__ = "1.0.0" __all__ = ( "Queue", "PriorityQueue", @@ -110,14 +110,9 @@ async def join(self) -> None: ... -current_loop = getattr(asyncio, "get_running_loop", None) -if current_loop is None: - current_loop = asyncio.get_event_loop - - class Queue(Generic[T]): def __init__(self, maxsize: int = 0) -> None: - self._loop = current_loop() + self._loop = asyncio.get_running_loop() self._maxsize = maxsize self._init(maxsize) @@ -235,7 +230,7 @@ def f() -> None: with self._sync_mutex: self._sync_not_full.notify() - fut = self._loop.run_in_executor(None, f) + fut = asyncio.ensure_future(self._loop.run_in_executor(None, f)) fut.add_done_callback(self._pending.discard) self._pending.add(fut) diff --git a/setup.cfg b/setup.cfg index 70f4326..1e13b10 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,7 +30,6 @@ classifiers = Programming Language :: Python Programming Language :: Python :: 3 - Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 @@ -41,7 +40,7 @@ classifiers = keywords= janus, queue, asyncio [options] -python_requires = >=3.6 +python_requires = >=3.7 packages = find: # https://setuptools.readthedocs.io/en/latest/setuptools.html#setting-the-zip-safe-flag zip_safe = True diff --git a/tests/test_async.py b/tests/test_async.py index a21c029..95e051b 100644 --- a/tests/test_async.py +++ b/tests/test_async.py @@ -20,7 +20,7 @@ async def _test_repr_or_str(self, fn, expect_id): assert fn(q).startswith("