diff --git a/.github/workflows/ci-scripts-build.yml b/.github/workflows/ci-scripts-build.yml index c46ce43..0bbc685 100644 --- a/.github/workflows/ci-scripts-build.yml +++ b/.github/workflows/ci-scripts-build.yml @@ -1,7 +1,7 @@ name: pyDevSup # Trigger on pushes and PRs to any branch -on: [push, pull_request] +on: [push, pull_request, workflow_dispatch] env: SETUP_PATH: .ci-local:.ci @@ -159,6 +159,8 @@ jobs: python: "3.7" container: "python:3.7" profile: deb10 + test: # no - RuntimeError: Requires Base >=3.15 for iocBuildIsolated() + steps: - uses: actions/checkout@v3 with: diff --git a/devsupApp/src/dbfield.c b/devsupApp/src/dbfield.c index 94da410..5e9e269 100644 --- a/devsupApp/src/dbfield.c +++ b/devsupApp/src/dbfield.c @@ -3,7 +3,6 @@ #undef _POSIX_C_SOURCE #undef _XOPEN_SOURCE -#include #ifdef HAVE_NUMPY #include #endif @@ -118,15 +117,15 @@ static int assign_array(DBADDR *paddr, PyObject *arr) #ifdef HAVE_NUMPY void *rawfield = paddr->pfield; rset *prset; - PyObject *aval; - PyArrayObject *array = (PyArrayObject *)arr; + PyArrayObject *aval; + PyArrayObject * array = (PyArrayObject *)arr; unsigned elemsize = dbValueSize(paddr->field_type); unsigned long maxlen = paddr->no_elements, insize; PyArray_Descr *desc = dbf2np[paddr->field_type]; if(paddr->field_type==DBF_STRING && - (PyArray_NDIM(array) != 2 || - PyArray_DIM(array, 0) > (npy_intp) maxlen || + (PyArray_NDIM(array) != 2 || + PyArray_DIM(array, 0) > (npy_intp) maxlen || PyArray_DIM(array, 1) != MAX_STRING_SIZE)) { PyErr_Format(PyExc_ValueError, "String array has incorrect shape or is too large"); @@ -159,17 +158,17 @@ static int assign_array(DBADDR *paddr, PyObject *arr) } Py_XINCREF(desc); - if(!(aval = PyArray_FromAny(arr, desc, 1, 2, NPY_ARRAY_C_CONTIGUOUS | NPY_ARRAY_ALIGNED | NPY_ARRAY_WRITEABLE, arr))) + if(!(aval = (PyArrayObject *)PyArray_FromAny(arr, desc, 1, 2, NPY_ARRAY_C_CONTIGUOUS | NPY_ARRAY_ALIGNED | NPY_ARRAY_WRITEABLE, arr))) return 1; - if(elemsize!=PyArray_ITEMSIZE((PyArrayObject *)aval)) { + if(elemsize!=PyArray_ITEMSIZE(aval)) { PyErr_Format(PyExc_AssertionError, "item size mismatch %u %u", - elemsize, (unsigned)PyArray_ITEMSIZE((PyArrayObject *)aval)); + elemsize, (unsigned)PyArray_ITEMSIZE(aval) ); Py_DECREF(aval); return 1; } - memcpy(rawfield, PyArray_GETPTR1((PyArrayObject *)aval, 0), insize*elemsize); + memcpy(rawfield, PyArray_GETPTR1(aval, 0), insize*elemsize); Py_DECREF(aval); diff --git a/devsupApp/src/devsup/disect.py b/devsupApp/src/devsup/disect.py index d166f74..b826361 100644 --- a/devsupApp/src/devsup/disect.py +++ b/devsupApp/src/devsup/disect.py @@ -4,6 +4,7 @@ import sys, gc, inspect, time try: + InstanceType = None from types import InstanceType except ImportError: pass # py3 diff --git a/documentation/index.rst b/documentation/index.rst index e3a86d1..fd5ad57 100644 --- a/documentation/index.rst +++ b/documentation/index.rst @@ -11,9 +11,18 @@ pydevsup documentation It currently supports EPICS >=3.14.12 and python versions >=3.6 The numpy package is also required. -The source can be found at http://github.com/mdavidsaver/pyDevSup - -File releases are available at https://github.com/mdavidsaver/pyDevSup/releases +It is not possible to use the module with a static build configuration. +The code will build, but it will not work. +The reason is that EPICS database defintions are created in two modules: +1. The _dbapi module creates the defintion of 'Python Device'. +2. The softIocPy module implements device types such as longin that use 'Python Device'. + In a static build, these are held in seperate EPICS databases. + Consequently the softIocPy module does not know what a 'Python Device' is. + In a shared library build there is ony one database, held by the underlying EPICS base library. + +The source can be found at http://github.com/epics-modules/pyDevSup + +File releases are available at https://github.com/epics-modules/pyDevSup/releases Contents: diff --git a/pyIocApp/setup.c b/pyIocApp/setup.c index 61c3861..0f87fe2 100644 --- a/pyIocApp/setup.c +++ b/pyIocApp/setup.c @@ -130,7 +130,10 @@ static void cleanupPrep(initHookState state) static void pySetupReg(void) { Py_InitializeEx(0); +#if NPY_TARGET_VERSION < NPY_1_9_API_VERSION + /* See https://docs.python.org/3/whatsnew/3.9.html */ PyEval_InitThreads(); +#endif setupPyPath(); diff --git a/requirements-deb10.txt b/requirements-deb10.txt index 91aeff2..039a17d 100644 --- a/requirements-deb10.txt +++ b/requirements-deb10.txt @@ -1,3 +1,2 @@ numpy==1.16.2 -#nose==1.3.7 nose2