Skip to content

Commit 55ca5da

Browse files
authored
Merge pull request #692 from zware/dep_update
chore: Dependency-related updates
2 parents 6f2cadb + a745b65 commit 55ca5da

File tree

6 files changed

+32
-62
lines changed

6 files changed

+32
-62
lines changed

.github/workflows/docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v6
1414
- name: Setup Python 3.12
15-
uses: actions/setup-python@v2
15+
uses: actions/setup-python@v6
1616
with:
1717
python-version: "3.12"
1818
- name: Cache virtualenv
1919
id: venv-cache
20-
uses: actions/cache@v3
20+
uses: actions/cache@v5
2121
with:
2222
path: .venv
2323
key: venv-${{ runner.os }}-${{ github.job }}-${{ github.ref }}-3.12
@@ -28,7 +28,7 @@ jobs:
2828
- name: Install Poetry
2929
run: python -m pip install poetry
3030
- name: Cache Poetry and pip
31-
uses: actions/cache@v3
31+
uses: actions/cache@v5
3232
with:
3333
path: |
3434
~/.cache/pypoetry

.github/workflows/tests.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ jobs:
1212
pylama:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v6
1616
- name: Setup python3.10
17-
uses: actions/setup-python@v2
17+
uses: actions/setup-python@v6
1818
with:
1919
python-version: "3.10"
2020
- name: Cache virtualenv
2121
id: venv-cache
22-
uses: actions/cache@v3
22+
uses: actions/cache@v5
2323
with:
2424
path: .venv
2525
key: venv-${{ runner.os }}-${{ github.job }}-${{ github.ref }}
@@ -31,14 +31,14 @@ jobs:
3131
mypy:
3232
runs-on: ubuntu-latest
3333
steps:
34-
- uses: actions/checkout@v2
34+
- uses: actions/checkout@v6
3535
- name: Setup python3.10
36-
uses: actions/setup-python@v2
36+
uses: actions/setup-python@v6
3737
with:
3838
python-version: "3.10"
3939
- name: Cache virtualenv
4040
id: venv-cache
41-
uses: actions/cache@v3
41+
uses: actions/cache@v5
4242
with:
4343
path: .venv
4444
key: venv-${{ runner.os }}-${{ github.job }}-${{ github.ref }}
@@ -60,15 +60,16 @@ jobs:
6060
- '3.11'
6161
- '3.12'
6262
- '3.13'
63+
- '3.14'
6364
steps:
64-
- uses: actions/checkout@v2
65+
- uses: actions/checkout@v6
6566
- name: Setup python${{ matrix.python }}
66-
uses: actions/setup-python@v2
67+
uses: actions/setup-python@v6
6768
with:
6869
python-version: "${{ matrix.python }}"
6970
- name: Cache virtualenv
7071
id: venv-cache
71-
uses: actions/cache@v3
72+
uses: actions/cache@v5
7273
with:
7374
path: .venv
7475
key: venv-${{ runner.os }}-${{ github.job }}-${{ github.ref }}-${{ matrix.python }}

aio_pika/tools.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,14 @@
77
from itertools import chain
88
from threading import Lock
99
from typing import (
10-
AbstractSet, Any, Awaitable, Callable, Coroutine, Generator, Iterator,
11-
List,
12-
MutableSet, Optional, TypeVar, Union, Generic,
10+
AbstractSet, Any, Awaitable, Callable, Coroutine, Generator, Generic,
11+
Iterator, List, MutableSet, Optional, ParamSpec, Protocol, TypeVar, Union,
1312
)
14-
1513
from weakref import ReferenceType, WeakSet, ref
1614

1715
from aio_pika.log import get_logger
1816

1917

20-
try:
21-
from typing import ParamSpec, Protocol
22-
except ImportError:
23-
from typing_extensions import ParamSpec, Protocol # type: ignore
24-
25-
2618
log = get_logger(__name__)
2719
T = TypeVar("T")
2820

poetry.lock

Lines changed: 4 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ classifiers = [
1919
"Programming Language :: Python :: 3.11",
2020
"Programming Language :: Python :: 3.12",
2121
"Programming Language :: Python :: 3.13",
22+
"Programming Language :: Python :: 3.14",
2223
"Programming Language :: Python :: Implementation :: CPython",
2324
"Programming Language :: Python :: Implementation :: PyPy",
2425
"Programming Language :: Python",
@@ -39,7 +40,6 @@ python = "^3.10"
3940
aiormq = "^6.8"
4041
yarl = [{ version = '*'}]
4142
exceptiongroup = [{ version = "^1", python = "< 3.11" }]
42-
typing-extensions = [{ version = '*', python = "< 3.10" }]
4343

4444
[tool.poetry.group.dev.dependencies]
4545
aiomisc = "^17.5"
@@ -57,8 +57,7 @@ shortuuid = "^1.0"
5757
sphinx = "*"
5858
sphinx-autobuild = "^2021.3.14"
5959
timeout-decorator = "^0.5.0"
60-
types-setuptools = "^65.6.0.2"
61-
typing-extensions = "*"
60+
# Seems to be implicitly required by pylama
6261
setuptools = "^69.0.3"
6362
testcontainers = "^3.7.1"
6463
autodoc = "*"

tests/test_memory_leak.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import gc
22
import weakref
33
from functools import partial
4-
from typing import AbstractSet
54

65
import pytest
76

@@ -13,7 +12,7 @@
1312
async def test_leak_unclosed_channel(create_connection):
1413
rabbitmq_connection = await create_connection()
1514

16-
weakset: AbstractSet[aio_pika.abc.AbstractChannel] = weakref.WeakSet()
15+
weakset: weakref.WeakSet[aio_pika.abc.AbstractChannel] = weakref.WeakSet()
1716

1817
async def f(rabbitmq_connection: aio_pika.Connection, weakset):
1918
weakset.add(await rabbitmq_connection.channel())
@@ -30,7 +29,9 @@ async def f(rabbitmq_connection: aio_pika.Connection, weakset):
3029
async def test_leak_closed_channel(create_connection):
3130
rabbitmq_connection = await create_connection()
3231

33-
weakset: AbstractSet[aio_pika.abc.AbstractConnection] = weakref.WeakSet()
32+
weakset: weakref.WeakSet[aio_pika.abc.AbstractConnection] = (
33+
weakref.WeakSet()
34+
)
3435

3536
async def f(rabbitmq_connection: aio_pika.Connection, weakset):
3637
async with rabbitmq_connection.channel() as channel:
@@ -64,7 +65,7 @@ async def test_get_exchange_no_memory_leak(create_robust_connection):
6465
"""
6566
connection = await create_robust_connection()
6667

67-
weakset: AbstractSet[aio_pika.abc.AbstractExchange] = weakref.WeakSet()
68+
weakset: weakref.WeakSet[aio_pika.abc.AbstractExchange] = weakref.WeakSet()
6869

6970
async with connection:
7071
channel: RobustChannel = await connection.channel() # type: ignore
@@ -87,7 +88,10 @@ async def test_get_exchange_no_memory_leak(create_robust_connection):
8788
# Verify internal storage doesn't grow
8889
assert name in channel._exchanges
8990
# Should be a single exchange, not a set/list of exchanges
90-
assert isinstance(channel._exchanges[name], aio_pika.abc.AbstractExchange)
91+
assert isinstance(
92+
channel._exchanges[name],
93+
aio_pika.abc.AbstractExchange
94+
)
9195

9296

9397
async def test_get_queue_no_memory_leak(create_robust_connection):
@@ -99,7 +103,7 @@ async def test_get_queue_no_memory_leak(create_robust_connection):
99103
"""
100104
connection = await create_robust_connection()
101105

102-
weakset: AbstractSet[aio_pika.abc.AbstractQueue] = weakref.WeakSet()
106+
weakset: weakref.WeakSet[aio_pika.abc.AbstractQueue] = weakref.WeakSet()
103107

104108
async with connection:
105109
channel: RobustChannel = await connection.channel() # type: ignore

0 commit comments

Comments
 (0)