Skip to content

Commit

Permalink
DEV: make kafka optional
Browse files Browse the repository at this point in the history
  • Loading branch information
tacaswell committed Nov 25, 2024
1 parent b5fc78e commit 707495d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ jobs:
# installation problems if out of date.
python -m pip install --upgrade pip setuptools numpy
pip install .
pip install -r requirements-dev.txt
pip install .[all]
pip install "pydantic${{ matrix.pydantic-version }}"
pip install bluesky==1.11.0
Expand Down
3 changes: 2 additions & 1 deletion bluesky_queueserver/manager/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,6 @@ def _worker_startup_code(self):
from bluesky import RunEngine
from bluesky.callbacks.best_effort import BestEffortCallback
from bluesky.utils import PersistentDict
from bluesky_kafka import Publisher as kafkaPublisher

from .profile_tools import global_user_namespace

Expand Down Expand Up @@ -1511,6 +1510,8 @@ def factory(name, doc):
self._RE.subscribe(self._db.insert)

if "kafka" in self._config_dict:
from bluesky_kafka import Publisher as kafkaPublisher

logger.info(
"Subscribing to Kafka: topic '%s', servers '%s'",
self._config_dict["kafka"]["topic"],
Expand Down
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ fastapi[all]
# moved from requirements.txt
pandas
pyarrow
matplotlib # Needed for BEC, should be factored out
scikit-image # Needed for BEC/other stuff to run, factor out
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
bluesky>=1.7.0
bluesky-kafka
databroker
event-model
ipykernel
Expand Down
25 changes: 21 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
Upgrade pip like so:
pip install --upgrade pip
""".format(
*(sys.version_info[:2] + min_version)
)
""".format(*(sys.version_info[:2] + min_version))
sys.exit(error)

here = path.abspath(path.dirname(__file__))
Expand All @@ -32,7 +30,25 @@

with open(path.join(here, "requirements.txt")) as requirements_file:
# Parse requirements.txt, ignoring any commented-out lines.
requirements = [line for line in requirements_file.read().splitlines() if not line.startswith("#")]
requirements = [
line
for line in requirements_file.read().splitlines()
if not line.startswith("#")
]

with open(path.join(here, "requirements-dev.txt")) as requirements_file:
# Parse requirements.txt, ignoring any commented-out lines.
requirements_dev = [
line
for line in requirements_file.read().splitlines()
if not line.startswith("#")
]

requirements_kafka = ["bluesky-kafka"]

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


setup(
name="bluesky-queueserver",
Expand All @@ -58,6 +74,7 @@
"qserver-console-monitor = bluesky_queueserver.manager.output_streaming:qserver_console_monitor_cli",
],
},
extras_require=extras_require,
include_package_data=True,
package_data={
"bluesky_queueserver": [
Expand Down

0 comments on commit 707495d

Please sign in to comment.