Skip to content

Commit

Permalink
Merge pull request #122 from ZLLentz/bld_bundle_script
Browse files Browse the repository at this point in the history
BLD/MAINT: bundle bin script, make psdaq optional, include tests in dist
  • Loading branch information
ZLLentz authored Apr 13, 2023
2 parents b9f0ca8 + 07102fc commit 6dfbb11
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,4 @@ ENV/

# vim
*.swp
*.un~
2 changes: 2 additions & 0 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ requirements:
test:
imports:
- pcdsdaq
commands:
- pcdsdaq_lib_setup
requires:
- pytest
- pytest-timeout
Expand Down
8 changes: 8 additions & 0 deletions docs/source/releases.rst
Original file line number Diff line number Diff line change
@@ -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)
===================

Expand Down
14 changes: 12 additions & 2 deletions pcdsdaq/daq/lcls2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)


Expand Down Expand Up @@ -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(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 7 additions & 1 deletion tests/test_daq_lcls2.py → pcdsdaq/tests/test_daq_lcls2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -30,6 +31,9 @@ where = [ ".",]
include = [ "pcdsdaq*",]
namespaces = false

[tool.setuptools]
script-files = [ "bin/pcdsdaq_lib_setup",]

[tool.setuptools.dynamic.readme]
file = "README.rst"

Expand Down

0 comments on commit 6dfbb11

Please sign in to comment.