Skip to content
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
6 changes: 6 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
"black"
],
"allowedVersions": "<24.10.0"
},
{
"matchPackageNames": [
"mypy"
],
"allowedVersions": "<1.15.0"
}
]
}
2 changes: 1 addition & 1 deletion asyncpg-stubs/compat.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ else:
if sys.version_info >= (3, 11):
from enum import StrEnum as StrEnum
else:
class StrEnum(str, enum.Enum): ...
class StrEnum(str, enum.Enum): ... # type: ignore[misc]
28 changes: 14 additions & 14 deletions asyncpg-stubs/connect_utils.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ _PasswordType: TypeAlias = str | Callable[[], str] | Callable[[], Awaitable[str]
PGPASSFILE: Final[str]

class SSLMode(IntEnum):
disable: int
allow: int
prefer: int
require: int
verify_ca: int
verify_full: int
disable = 0
allow = 1
prefer = 2
require = 3
verify_ca = 4
verify_full = 5
@classmethod
def parse(cls, sslmode: str | Self) -> Self: ...

class SSLNegotiation(compat.StrEnum):
postgres: str
direct: str
postgres = 'postgres' # noqa: PYI052
direct = 'direct' # noqa: PYI052

class _ConnectionParameters(NamedTuple):
user: str
Expand Down Expand Up @@ -64,12 +64,12 @@ class TLSUpgradeProto(Protocol):
def connection_lost(self, exc: Exception | None) -> None: ...

class SessionAttribute(str, Enum):
any: str
primary: str
standby: str
prefer_standby: str
read_write: str
read_only: str
any = 'any'
primary = 'primary'
standby = 'standby'
prefer_standby = 'prefer-standby'
read_write = 'read-write'
read_only = 'read-only'

target_attrs_check: Final[
dict[SessionAttribute, Callable[[connection.Connection[Any]], Any]]
Expand Down
8 changes: 3 additions & 5 deletions asyncpg-stubs/exceptions/_base.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, ClassVar, TypeVar
from typing import Any, ClassVar
from typing_extensions import Self

__all__ = (
Expand All @@ -17,8 +17,6 @@ __all__ = (
'UnsupportedServerFeatureError',
)

_PM = TypeVar('_PM', bound=PostgresMessage)

class PostgresMessageMeta(type): ...

class PostgresMessage(metaclass=PostgresMessageMeta):
Expand All @@ -42,8 +40,8 @@ class PostgresMessage(metaclass=PostgresMessageMeta):
server_source_function: str | None
@classmethod
def _make_constructor(
cls: type[_PM], fields: dict[str, str], query: str | None = ...
) -> tuple[type[_PM], str, dict[str, str]]: ...
cls, fields: dict[str, str], query: str | None = ...
) -> tuple[Self, str, dict[str, str]]: ...
def as_dict(self) -> dict[str, str]: ...

class PostgresError(PostgresMessage, Exception):
Expand Down
10 changes: 5 additions & 5 deletions asyncpg-stubs/transaction.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ from typing_extensions import TypeAlias
from . import connection as _connection, connresource

class TransactionState(Enum):
NEW: int
STARTED: int
COMMITTED: int
ROLLEDBACK: int
FAILED: int
NEW = 0
STARTED = 1
COMMITTED = 2
ROLLEDBACK = 3
FAILED = 4

_IsolationLevels: TypeAlias = Literal[
'read_committed', 'read_uncommitted', 'serializable', 'repeatable_read'
Expand Down
147 changes: 85 additions & 62 deletions poetry.lock

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ typing-extensions = "^4.7.0"
async-timeout = "5.0.1"
black = "24.8.0"
pre-commit = "3.5.0"
mypy = "1.13.0"
ruff = "0.8.3"
mypy = "1.14.0"
ruff = "0.11.0"

[tool.black]
line-length = 88
Expand Down Expand Up @@ -87,6 +87,7 @@ venvPath = "."
venv = ".venv"

pythonVersion = "3.8"
enableTypeIgnoreComments = "false"
reportUnnecessaryTypeIgnoreComment = "warning"
typeCheckingMode = "strict"
reportPrivateUsage = "none"
Expand Down
Loading