diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 6fa85855..3095af7b 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -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 diff --git a/bluesky_queueserver/manager/worker.py b/bluesky_queueserver/manager/worker.py index e10b399d..84964270 100644 --- a/bluesky_queueserver/manager/worker.py +++ b/bluesky_queueserver/manager/worker.py @@ -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 @@ -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"], diff --git a/requirements-dev.txt b/requirements-dev.txt index 1caf056c..b8c79587 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -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 diff --git a/requirements.txt b/requirements.txt index c66969bc..9fd3a167 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ bluesky>=1.7.0 -bluesky-kafka databroker event-model ipykernel diff --git a/setup.py b/setup.py index ce90918b..61c8a17d 100644 --- a/setup.py +++ b/setup.py @@ -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__)) @@ -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", @@ -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": [