Open
Show file tree
Hide file tree
Changes from all commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Failed to load files.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
[flake8]
select = C90,E,F,W,Y0
ignore = E402,E731,W503,W504,E252
exclude = .git,__pycache__,build,dist,.eggs,.,.local,.venv,.tox
exclude = .git,__pycache__,build,dist,.eggs,.,.local,.venv*,.tox
per-file-ignores = *.pyi: F401, F403, F405, F811, E127, E128, E203, E266, E301, E302, E305, E501, E701, E704, E741, B303, W503, W504
Original file line numberDiff line numberDiff line change
Expand Up@@ -22,7 +22,7 @@ jobs:
_token: ${{ secrets.RELEASE_BOT__TOKEN }}
version_file: asyncpg/_version.py
version_line_pattern: |
__version__\s*=\s*(?:['"])([[:PEP440:]])(?:['"])
__version__(?:\s*:\s*typing\.Final)?\s*=\s*(?:['"])([[:PEP440:]])(?:['"])

- name: Stop if not approved
if: steps.checkver.outputs.approved != 'true'
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
recursive-include docs *.py *.rst Makefile *.css
recursive-include examples *.py
recursive-include tests *.py *.pem
recursive-include asyncpg *.pyx *.pxd *.pxi *.py *.c *.h
recursive-include asyncpg *.pyx *.pxd *.pxi *.py *.pyi *.c *.h
include LICENSE README.rst Makefile performance.png .flake8
include asyncpg/py.typed
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,16 +4,17 @@
# This module is part of asyncpg and is released under
# the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0

from __future__ import annotations

from .connection import connect, Connection # NOQA
from .exceptions import * # NOQA
from .pool import create_pool, Pool # NOQA
from .protocol import Record # NOQA
from .types import * # NOQA


from . import exceptions
from ._version import __version__ # NOQA


__all__ = ('connect', 'create_pool', 'Pool', 'Record', 'Connection')
__all__ = ['connect', 'create_pool', 'Pool', 'Record', 'Connection']
__all__ += exceptions.__all__ # NOQA
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,18 +4,28 @@
#
# SPDX-License-Identifier: PSF-2.0

from __future__ import annotations

import asyncio
import functools
import sys
import typing

if typing.TYPE_CHECKING:
from . import compat

if sys.version_info < (3, 11):
from async_timeout import timeout as timeout_ctx
else:
from asyncio import timeout as timeout_ctx


async def wait_for(fut, timeout):
_T = typing.TypeVar('_T')


async def wait_for(
fut: compat.Awaitable[_T], timeout: float | None
) -> _T:
"""Wait for the single Future or coroutine to complete, with timeout.

Coroutine will be wrapped in Task.
Expand DownExpand Up@@ -65,7 +75,7 @@ async def wait_for(fut, timeout):
return await fut


async def _cancel_and_wait(fut):
async def _cancel_and_wait(fut: asyncio.Future[_T]) -> None:
"""Cancel the *fut* future or task and wait until it completes."""

loop = asyncio.get_running_loop()
Expand All@@ -82,6 +92,6 @@ async def _cancel_and_wait(fut):
fut.remove_done_callback(cb)


def _release_waiter(waiter, *args):
def _release_waiter(waiter: asyncio.Future[typing.Any], *args: object) -> None:
if not waiter.done():
waiter.set_result(None)
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,4 +10,8 @@
# supported platforms, publish the packages on PyPI, merge the PR
# to the target branch, create a Git tag pointing to the commit.

__version__ = '0.30.0.dev0'
from __future__ import annotations

import typing

__version__: typing.Final = '0.30.0.dev0'
Loading