From da49fb48df8f8b8e8fc12547997b60563cac89b2 Mon Sep 17 00:00:00 2001 From: Zachary Lentz Date: Thu, 13 Apr 2023 10:16:31 -0700 Subject: [PATCH 1/7] BLD: check that psdaq_lib_setup exists during conda build --- conda-recipe/meta.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index c3c8337..a67cfcd 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -30,6 +30,8 @@ requirements: test: imports: - pcdsdaq + commands: + - psdaq_lib_setup requires: - pytest - pytest-timeout From 79d456a3791006848201de649567ab389d899456 Mon Sep 17 00:00:00 2001 From: Zachary Lentz Date: Thu, 13 Apr 2023 10:17:59 -0700 Subject: [PATCH 2/7] MAINT: ignore vim undo files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2aac0a0..fa34d94 100644 --- a/.gitignore +++ b/.gitignore @@ -107,3 +107,4 @@ ENV/ # vim *.swp +*.un~ From 1a0081e1941606f3a315bfcab926cd2c93da3fcf Mon Sep 17 00:00:00 2001 From: Zachary Lentz Date: Thu, 13 Apr 2023 11:26:00 -0700 Subject: [PATCH 3/7] BLD: use the only way to include a script in pyproject.toml --- pyproject.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b3a438b..8b013b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,12 +3,13 @@ build-backend = "setuptools.build_meta" requires = [ "setuptools>=45", "setuptools_scm[toml]>=6.2",] [project] -classifiers = [ "Development Status :: 2 - Pre-Alpha", "Natural Language :: English", "Programming Language :: Python :: 3",] +classifiers = [ "Development Status :: 5 - Production/Stable", "Natural Language :: English", "Programming Language :: Python :: 3",] description = "DAQ Control Interface" dynamic = [ "version", "readme", "dependencies", "optional-dependencies", "optional-dependencies",] keywords = [] name = "pcdsdaq" requires-python = ">=3.9" + [[project.authors]] name = "SLAC National Accelerator Laboratory" @@ -30,6 +31,9 @@ where = [ ".",] include = [ "pcdsdaq*",] namespaces = false +[tool.setuptools] +script-files = [ "bin/pcdsdaq_lib_setup",] + [tool.setuptools.dynamic.readme] file = "README.rst" From c9aa9f0f8a31efea76ecf115490a2e5cfc2e5294 Mon Sep 17 00:00:00 2001 From: Zachary Lentz Date: Thu, 13 Apr 2023 11:39:34 -0700 Subject: [PATCH 4/7] MAINT/TST: allow running most of test suite without optional psdaq install --- pcdsdaq/daq/lcls2.py | 14 ++++++++++++-- tests/test_daq_lcls2.py | 8 +++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/pcdsdaq/daq/lcls2.py b/pcdsdaq/daq/lcls2.py index d6306b0..588fd06 100644 --- a/pcdsdaq/daq/lcls2.py +++ b/pcdsdaq/daq/lcls2.py @@ -57,14 +57,19 @@ from ophyd.utils import StatusTimeoutError, WaitTimeoutError from ophyd.utils.errors import InvalidState from pcdsutils.enum import HelpfulIntEnum -from psdaq.control.ControlDef import ControlDef -from psdaq.control.DaqControl import DaqControl from .interface import (CONFIG_VAL, ControlsArg, DaqBase, DaqStateTransitionError, DaqTimeoutError, EnumId, Sentinel, TernaryBool, get_controls_name, get_controls_value, typing_check) +try: + from psdaq.control.ControlDef import ControlDef + from psdaq.control.DaqControl import DaqControl +except ImportError: + ControlDef = None + DaqControl = None + logger = logging.getLogger(__name__) @@ -1811,6 +1816,11 @@ class SimDaqControl: def __init__(self, *args, **kwargs): logger.debug("SimDaqControl.__init__(%s, %s)", args, kwargs) + if None in (ControlDef, DaqControl): + raise RuntimeError( + 'Optional dependency psdaq is not installed, ' + 'cannot run lcls2 daq' + ) self._lock = threading.RLock() self._new_status = threading.Event() self._headers = HelpfulIntEnum( diff --git a/tests/test_daq_lcls2.py b/tests/test_daq_lcls2.py index e3bed97..8f11881 100644 --- a/tests/test_daq_lcls2.py +++ b/tests/test_daq_lcls2.py @@ -12,16 +12,22 @@ from ophyd.signal import Signal from ophyd.sim import motor from ophyd.utils.errors import WaitTimeoutError -from psdaq.control.ControlDef import ControlDef from pcdsdaq.daq import DaqLCLS2, DaqTimeoutError from pcdsdaq.daq.interface import DaqStateTransitionError, TernaryBool +try: + from psdaq.control.ControlDef import ControlDef +except ImportError: + ControlDef = None + logger = logging.getLogger(__name__) @pytest.fixture(scope='function') def daq_lcls2(RE: RunEngine) -> DaqLCLS2: + if ControlDef is None: + pytest.skip(reason='psdaq is not installed') return DaqLCLS2( platform=0, host='tst', From c3bec93ddb98fe85f56b693756ec1c020408eda3 Mon Sep 17 00:00:00 2001 From: Zachary Lentz Date: Thu, 13 Apr 2023 11:40:18 -0700 Subject: [PATCH 5/7] TST: include tests in distribution --- {tests => pcdsdaq/tests}/__init__.py | 0 {tests => pcdsdaq/tests}/conftest.py | 0 {tests => pcdsdaq/tests}/test_ami.py | 0 {tests => pcdsdaq/tests}/test_daq_lcls2.py | 0 {tests => pcdsdaq/tests}/test_daq_original.py | 0 {tests => pcdsdaq/tests}/test_ext_scripts.py | 0 {tests => pcdsdaq/tests}/test_preprocessors.py | 0 {tests => pcdsdaq/tests}/test_scan_vars.py | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename {tests => pcdsdaq/tests}/__init__.py (100%) rename {tests => pcdsdaq/tests}/conftest.py (100%) rename {tests => pcdsdaq/tests}/test_ami.py (100%) rename {tests => pcdsdaq/tests}/test_daq_lcls2.py (100%) rename {tests => pcdsdaq/tests}/test_daq_original.py (100%) rename {tests => pcdsdaq/tests}/test_ext_scripts.py (100%) rename {tests => pcdsdaq/tests}/test_preprocessors.py (100%) rename {tests => pcdsdaq/tests}/test_scan_vars.py (100%) diff --git a/tests/__init__.py b/pcdsdaq/tests/__init__.py similarity index 100% rename from tests/__init__.py rename to pcdsdaq/tests/__init__.py diff --git a/tests/conftest.py b/pcdsdaq/tests/conftest.py similarity index 100% rename from tests/conftest.py rename to pcdsdaq/tests/conftest.py diff --git a/tests/test_ami.py b/pcdsdaq/tests/test_ami.py similarity index 100% rename from tests/test_ami.py rename to pcdsdaq/tests/test_ami.py diff --git a/tests/test_daq_lcls2.py b/pcdsdaq/tests/test_daq_lcls2.py similarity index 100% rename from tests/test_daq_lcls2.py rename to pcdsdaq/tests/test_daq_lcls2.py diff --git a/tests/test_daq_original.py b/pcdsdaq/tests/test_daq_original.py similarity index 100% rename from tests/test_daq_original.py rename to pcdsdaq/tests/test_daq_original.py diff --git a/tests/test_ext_scripts.py b/pcdsdaq/tests/test_ext_scripts.py similarity index 100% rename from tests/test_ext_scripts.py rename to pcdsdaq/tests/test_ext_scripts.py diff --git a/tests/test_preprocessors.py b/pcdsdaq/tests/test_preprocessors.py similarity index 100% rename from tests/test_preprocessors.py rename to pcdsdaq/tests/test_preprocessors.py diff --git a/tests/test_scan_vars.py b/pcdsdaq/tests/test_scan_vars.py similarity index 100% rename from tests/test_scan_vars.py rename to pcdsdaq/tests/test_scan_vars.py From 4ebcd48876613f2cc4f355172e30f2d0dd0c1899 Mon Sep 17 00:00:00 2001 From: Zachary Lentz Date: Thu, 13 Apr 2023 11:48:57 -0700 Subject: [PATCH 6/7] BLD: typo --- conda-recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index a67cfcd..ff8288c 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -31,7 +31,7 @@ test: imports: - pcdsdaq commands: - - psdaq_lib_setup + - pcdsdaq_lib_setup requires: - pytest - pytest-timeout From 07102fcb669d08806ffb1ee6d4e4d9bbfee38cac Mon Sep 17 00:00:00 2001 From: Zachary Lentz Date: Thu, 13 Apr 2023 12:02:39 -0700 Subject: [PATCH 7/7] DOC: add release notes for v2.4.2 --- docs/source/releases.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/source/releases.rst b/docs/source/releases.rst index 4d9b07d..c698bd5 100644 --- a/docs/source/releases.rst +++ b/docs/source/releases.rst @@ -1,6 +1,14 @@ Release History ############### +v2.4.2 (2023-04-13) +=================== + +- Fix issues related to the missing pcdsdaq_lib_setup script +- Fix issues related to failing pypi builds +- Fix issues related to failing docs builds + + v2.4.1 (2023-04-11) ===================