Bug 54037 - faststream - не работает брокер Redis
Summary: faststream - не работает брокер Redis
Status: NEW
Alias: None
Product: Sisyphus
Classification: Development
Component: python3-module-faststream (show other bugs)
Version: unstable
Hardware: all Linux
: P5 normal
Assignee: Sergei Dunaev
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-28 13:33 MSK by Руслан Вишталмагомедов
Modified: 2025-04-29 10:54 MSK (History)
1 user (show)

See Also:


Attachments
лог с ошибкой с версией из репозитория (55.86 KB, text/x-log)
2025-04-28 13:33 MSK, Руслан Вишталмагомедов
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Руслан Вишталмагомедов 2025-04-28 13:33:32 MSK
Created attachment 18308 [details]
лог с ошибкой с версией из репозитория

стенды: (обновленные до Sisyphus)
ALT Server 11.0
ALT Workstation 11.0
ALT Workstation K 11.0

версии:
python3-module-faststream-0.5.39-alt1.noarch
python3-module-redis-py-4.5.5-alt1.1.noarch

шаги воспроизведения:
1.
# apt-get install redis python3-module-faststream && systemctl enable --now redis

2.
$ cat <<EOF > test.py
from faststream import FastStream
from faststream.redis import RedisBroker

broker = RedisBroker("redis://localhost:6379")
app = FastStream(broker)

@broker.subscriber("in-channel")
async def handle(msg):
    print(f"Received: {msg}")
EOF

3.
$ python3 -m faststream run test:app

Результат: Программа не запускается, возвращает ошибку AttributeError: type object 'Redis' has no attribute 'from_pool'

Ожидаемый результат: Программа запустилась, имеется вывод вида:
2025-04-28 13:25:30,461 INFO     - FastStream app starting...
2025-04-28 13:25:30,462 INFO     - in-channel |            - `Handle` waiting for messages
2025-04-28 13:25:30,468 INFO     - FastStream app started successfully! To exit, press CTRL+C

Дополнительно:
Программа запускается корректно, если в системе установлена свежая версия redis-py, например через pip
FastStream обращается к Redis функцией from_pool (/usr/lib/python3/site-packages/faststream/redis/broker/broker.py line 331)
В версии redis-5.2.1 (из pip) данная функция присутствует, однако в версии 4.5.5 из репозитория этой функции нет