From c194578b853581408b522e4501d540df4a82c760 Mon Sep 17 00:00:00 2001 From: nstelter-slac Date: Tue, 3 Dec 2024 17:59:03 -0800 Subject: [PATCH] MNT: stop install wrong pyca package through pip The correct package is on github: https://github.com/slaclab/pyca and on coda: https://anaconda.org/conda-forge/pyca. Need to switch to using correct package, which will fix 'psp' plugin related tests. (psp is part of pyca) Installing correct library and enabling test fixes issue where a user downloads pydm and runs the tests with pytest cmd directly (instead of run_tests.py), only to see 'no module named psp' failure. This failure seems to suggest to user to 'pip install psp', which is the wrong package and confusing. --- dev-requirements.txt | 1 - pydm/tests/data_plugins/test_psp_plugin_component.py | 6 ++++++ requirements.txt | 1 + run_tests.py | 1 - 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 8acd707df..a31c6bd65 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -4,5 +4,4 @@ pytest-qt pytest-cov pytest-timeout p4p -pyca pre-commit diff --git a/pydm/tests/data_plugins/test_psp_plugin_component.py b/pydm/tests/data_plugins/test_psp_plugin_component.py index 884515ccd..4aff68b24 100644 --- a/pydm/tests/data_plugins/test_psp_plugin_component.py +++ b/pydm/tests/data_plugins/test_psp_plugin_component.py @@ -1,3 +1,4 @@ +import time import functools import pydm.data_plugins.epics_plugins.psp_plugin_component from pydm.data_plugins.epics_plugins.psp_plugin_component import Connection @@ -19,6 +20,11 @@ def __init__(self): def severity(self): return None + def timestamp(self): + secs = time.time() + nanos = time.time_ns() + return secs, nanos + def test_update_ctrl_vars(monkeypatch: MonkeyPatch, signals: ConnectionSignals): """Invoke our callback for updating the control values for a PV as if we had a monitor on it. Verify diff --git a/requirements.txt b/requirements.txt index 9d3ff981a..5ded4ba81 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ pyqtgraph>=0.12.0 qtpy scipy>=0.12.0 six +git+https://github.com/slaclab/pyca.git diff --git a/run_tests.py b/run_tests.py index 4d3a49456..0cae5118b 100644 --- a/run_tests.py +++ b/run_tests.py @@ -21,7 +21,6 @@ # and a Windows PyCA build exists if os.name == "nt": args.append("--ignore=pydm/tests/data_plugins/test_p4p_plugin_component.py") - args.append("--ignore=pydm/tests/data_plugins/test_psp_plugin_component.py") print("pytest arguments: {}".format(args))