Skip to content

Commit

Permalink
DEV: make kafka an optional runtime dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
tacaswell committed Nov 25, 2024
1 parent 707495d commit a82a52b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions bluesky_queueserver/manager/start_manager.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import argparse
import atexit
import importlib
import logging
import os
import re
Expand Down Expand Up @@ -627,6 +628,13 @@ def formatter(prog):
"Use --zmq-info-addr instead."
)

if settings.kafka_topic is not None or settings.kafka_server is not None:
if importlib.util.find_spec("bluesky-kafka") is None:
logger.error(
"Must have bluesky-kafka installed to publish documents to kafka",
)
sys.exit(1)

msg_queue = Queue()
setup_console_output_redirection(msg_queue)

Expand Down
4 changes: 4 additions & 0 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ Installation Steps

$ pip install bluesky-queueserver

Install from PyPI with kafka dependencies::

$ pip install bluesky-queueserver[kafka]

Install from conda-forge::

$ conda install bluesky-queueserver -c conda-forge
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
requirements_kafka = ["bluesky-kafka"]

extras_require = {"dev": sorted(set(requirements_dev)), "kafka": requirements_kafka}
extras_require["all"] = sort(set(sum(extras_require.values())))
extras_require["all"] = sorted(set(sum(extras_require.values(), [])))


setup(
Expand Down

0 comments on commit a82a52b

Please sign in to comment.