Skip to content

Conversation

nneskildsf
Copy link
Contributor

@nneskildsf nneskildsf commented May 1, 2025

An option is available for each backend as well as an "all" option which gets you everything.

  • Install without options: pip install fastapi_websocket_pubsub
  • Install with Redis broadcaster: pip install fastapi_websocket_pubsub[redis]
  • Install with Postgres broadcaster: pip install fastapi_websocket_pubsub[postgres]
  • Install with Kafka broadcaster: pip install fastapi_websocket_pubsub[kafka]
  • Install with all options: pip install fastapi_websocket_pubsub[all]

This PR aims to close #57. I made this PR because it will enable me to install fastapi_websocket_pubsub on python:3.13-alpine Docker image without first installing build-base and zlib-dev.

Thanks a ton for this library. It's been quite useful and I appreciate that you maintain it and offer it to the community.

Br Eskild

An option is available for each backend as well as an "all" option which gets you everything.
@nneskildsf
Copy link
Contributor Author

Ping @orweis :-)

@orweis
Copy link
Contributor

orweis commented May 5, 2025

Ping @orweis :-)

Tests fail

I currently don't have the CPU to look into this.

@nneskildsf
Copy link
Contributor Author

Tests fail

I currently don't have the CPU to look into this.

Hi

I have improved the PR by:

  • Adding a note to the readme about installing the optional backends
  • Only running tests using optional backends if these are installed
  • Installing all optional modules when doing automated testing (requirements-dev.txt)

Unfortunately tests in tests/server_notifier_callback_test.py and it their failure appears to be unrelated to this PR. All other tests run successfully AFAIK.

I don't mind looking into why they fail and potentially fixing it but I think it is outside the scope of this PR. What do you think?

Br Eskild

@nneskildsf
Copy link
Contributor Author

nneskildsf commented May 6, 2025

Apparently the tests failed because the websockets package changed the API since version 11.0 (latest is 15.0.1 at the time of writing). Additional headers should now be supplied via additional_headers and not extra_headers. I have updated the PR to fix this, even though I do believe it is outside the scope of it.

All tests pass locally with websockets>=14.0 as well as through Github Actions.

Copy link
Contributor

@danyi1212 danyi1212 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 Breaking Changes Added

LGTM

@danyi1212 danyi1212 merged commit b5b3e40 into permitio:master May 14, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optional dependencies - Broadcaster Postgres dependency problem

3 participants