Skip to content

Commit

Permalink
require Python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
albertodonato committed Oct 30, 2024
1 parent e69372c commit ec9893a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
strategy:
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
Expand All @@ -59,7 +58,6 @@ jobs:
strategy:
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ maintainers = [
authors = [
{ name = "Alberto Donato", email = "[email protected]" },
]
requires-python = ">=3.10"
requires-python = ">=3.11"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Framework :: AsyncIO",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: GNU General Public License (GPL)",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
Expand Down
7 changes: 4 additions & 3 deletions query_exporter/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from typing import (
Any,
NamedTuple,
Self,
cast,
)

Expand Down Expand Up @@ -165,7 +166,7 @@ class QueryResults(NamedTuple):
latency: float | None = None

@classmethod
async def from_results(cls, results: AsyncResultProxy) -> "QueryResults":
async def from_results(cls, results: AsyncResultProxy) -> Self:
"""Return a QueryResults from results for a query."""
timestamp = time()
conn_info = results._result_proxy.connection.info
Expand Down Expand Up @@ -298,7 +299,7 @@ def __init__(

self._setup_query_latency_tracking()

async def __aenter__(self) -> "DataBase":
async def __aenter__(self) -> Self:
await self.connect()
return self

Expand Down Expand Up @@ -352,7 +353,7 @@ async def execute(self, query: Query) -> MetricResults:
try:
result = await self._execute_query(query)
return query.results(await QueryResults.from_results(result))
except asyncio.TimeoutError:
except TimeoutError:
raise self._query_timeout_error(
query.name, cast(QueryTimeout, query.timeout)
)
Expand Down

0 comments on commit ec9893a

Please sign in to comment.