diff --git a/.github/workflows/code.yml b/.github/workflows/code.yml index 91191efe..61605cef 100644 --- a/.github/workflows/code.yml +++ b/.github/workflows/code.yml @@ -87,7 +87,7 @@ jobs: run: cibuildwheel --output-dir dist env: CIBW_BUILD: ${{ matrix.python }}*64 - CIBW_TEST_REQUIRES: pytest-cov ${{ matrix.test_requires }} + CIBW_TEST_REQUIRES: pytest-cov p4p ${{ matrix.test_requires }} CIBW_TEST_COMMAND: pytest --cov=softioc {project}/tests --cov-report xml:${{ matrix.cov_file }} # Disable auditwheel as it isn't compatible with setuptools_dso approach # https://github.com/mdavidsaver/setuptools_dso/issues/17 diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d4c150a8..194d742d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -9,7 +9,9 @@ and this project adheres to `Semantic Versioning =7.0.4.99.1"] +requires = ["setuptools", "wheel", "setuptools_dso", "epicscorelibs>=7.0.6.99.1.0a1"] build-backend = "setuptools.build_meta:__legacy__" diff --git a/setup.py b/setup.py index 130fbd1a..de23a457 100644 --- a/setup.py +++ b/setup.py @@ -73,7 +73,16 @@ def _add_file(f): epicscorelibs.path.include_path, devIocStats_src, devIocStats_os, devIocStats_default ], - dsos = ['epicscorelibs.lib.dbCore', 'epicscorelibs.lib.Com'], + dsos = [ + 'epicscorelibs.lib.qsrv', + 'epicscorelibs.lib.pvAccessIOC', + 'epicscorelibs.lib.pvAccess', + 'epicscorelibs.lib.pvData', + 'epicscorelibs.lib.dbRecStd', + 'epicscorelibs.lib.dbCore', + 'epicscorelibs.lib.ca', + 'epicscorelibs.lib.Com', + ], define_macros = get_config_var('CPPFLAGS'), extra_compile_args = get_config_var('CFLAGS') + ["-std=c99"], extra_link_args = get_config_var('LDFLAGS'), diff --git a/softioc/__init__.py b/softioc/__init__.py index 35c9b808..7c6f6360 100644 --- a/softioc/__init__.py +++ b/softioc/__init__.py @@ -12,7 +12,8 @@ # Need to do this before calling anything in device.py iocshRegisterCommon() -dbLoadDatabase("base.dbd", os.path.join(path.base_path, "dbd"), None) +for dbd in ('base.dbd', 'PVAServerRegister.dbd', 'qsrv.dbd'): + dbLoadDatabase(dbd, os.path.join(path.base_path, "dbd"), None) dbLoadDatabase("devIocStats.dbd", os.path.dirname(__file__), None) if registerRecordDeviceDriver(pdbbase): diff --git a/softioc/imports.py b/softioc/imports.py index fc4e0e3a..5e95e49c 100644 --- a/softioc/imports.py +++ b/softioc/imports.py @@ -1,8 +1,6 @@ '''External DLL imports used for implementing Python EPICS device support. ''' -import os -import os.path import sys from ctypes import * diff --git a/softioc/softioc.py b/softioc/softioc.py index cf09bc8e..27d08f2b 100644 --- a/softioc/softioc.py +++ b/softioc/softioc.py @@ -224,7 +224,7 @@ def call_f(*args): ExportTest('eltc', (c_int,), (), '''\ eltc(noYes) -TThis determines if error messages are displayed on the IOC console. 0 means no +This determines if error messages are displayed on the IOC console. 0 means no and any other value means yes.''', lib=imports.Com) diff --git a/tests/test_asyncio.py b/tests/test_asyncio.py index 635b4e04..1a3bf8fa 100644 --- a/tests/test_asyncio.py +++ b/tests/test_asyncio.py @@ -54,6 +54,10 @@ async def test_asyncio_ioc(asyncio_ioc): assert await caget(PV_PREFIX + ":AI") == 12.34 await asyncio.sleep(0.8) assert await caget(PV_PREFIX + ":AI") == 3.56 + # Check pvaccess works + from p4p.client.asyncio import Context + with Context("pva") as ctx: + assert await ctx.get(PV_PREFIX + ":AI") == 3.56 # Wait for a bit longer for the print output to flush await asyncio.sleep(2) # Stop diff --git a/tests/test_cothread.py b/tests/test_cothread.py index 3212cd04..9c687c06 100644 --- a/tests/test_cothread.py +++ b/tests/test_cothread.py @@ -46,6 +46,10 @@ def test_cothread_ioc(cothread_ioc): assert caget(PV_PREFIX + ":STRINGOUT") == "watevah" caput(PV_PREFIX + ":STRINGOUT", "something", wait=True) assert caget(PV_PREFIX + ":STRINGOUT") == "something" + # Check pvaccess works + from p4p.client.cothread import Context + with Context("pva") as ctx: + assert ctx.get(PV_PREFIX + ":STRINGOUT") == "something" # Stop cothread_ioc.send_signal(signal.SIGINT) # Disconnect