From 68f9051c49d54b8c1e12a30f15cebee66fbf7b18 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 13 Mar 2023 08:32:56 +0000 Subject: [PATCH 1/6] switch to nose2 --- .github/workflows/ci-scripts-build.yml | 6 ++++++ devsupApp/src/Makefile | 2 +- requirements-deb10.txt | 3 ++- requirements-deb7.txt | 3 ++- requirements-deb8.txt | 3 ++- requirements-deb9.txt | 3 ++- requirements-latest.txt | 2 +- 7 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-scripts-build.yml b/.github/workflows/ci-scripts-build.yml index f77157b..6517e96 100644 --- a/.github/workflows/ci-scripts-build.yml +++ b/.github/workflows/ci-scripts-build.yml @@ -54,6 +54,12 @@ jobs: profile: latest test: yes + - os: ubuntu-latest + base: "7.0" + python: "3.10" + profile: latest + test: yes + - os: ubuntu-latest base: "3.15" python: "2.7" diff --git a/devsupApp/src/Makefile b/devsupApp/src/Makefile index 3a26547..9f1b468 100644 --- a/devsupApp/src/Makefile +++ b/devsupApp/src/Makefile @@ -61,7 +61,7 @@ pyconfig: ifneq (,$(T_A)) nose: - PYTHONPATH="${PYTHONPATH}:$(abspath $(TOP))/python$(PY_LD_VER)/$(EPICS_HOST_ARCH)" $(PYTHON) -m nose -P devsup $(NOSEFLAGS) + PYTHONPATH="${PYTHONPATH}:$(abspath $(TOP))/python$(PY_LD_VER)/$(EPICS_HOST_ARCH)" $(PYTHON) -m nose2 -v devsup $(NOSEFLAGS) # bounce back down to the sphinx generated Makefile # aren't Makefiles fun... diff --git a/requirements-deb10.txt b/requirements-deb10.txt index 382bf56..91aeff2 100644 --- a/requirements-deb10.txt +++ b/requirements-deb10.txt @@ -1,2 +1,3 @@ numpy==1.16.2 -nose==1.3.7 +#nose==1.3.7 +nose2 diff --git a/requirements-deb7.txt b/requirements-deb7.txt index 84d50dc..b143719 100644 --- a/requirements-deb7.txt +++ b/requirements-deb7.txt @@ -1,2 +1,3 @@ numpy==1.6.2 -nose==1.1.2 +#nose==1.1.2 +nose2 diff --git a/requirements-deb8.txt b/requirements-deb8.txt index 135f812..46ac10a 100644 --- a/requirements-deb8.txt +++ b/requirements-deb8.txt @@ -1,2 +1,3 @@ numpy==1.8.2 -nose==1.3.4 +#nose==1.3.4 +nose2 diff --git a/requirements-deb9.txt b/requirements-deb9.txt index d3e0a04..90d1c74 100644 --- a/requirements-deb9.txt +++ b/requirements-deb9.txt @@ -1,2 +1,3 @@ numpy==1.12.1 -nose==1.3.7 +#nose==1.3.7 +nose2 diff --git a/requirements-latest.txt b/requirements-latest.txt index 02e0c84..99ce0ab 100644 --- a/requirements-latest.txt +++ b/requirements-latest.txt @@ -1,2 +1,2 @@ numpy -nose +nose2 From 04f3a829429b01bee507ad801a472bf61e8fe768 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 13 Mar 2023 08:33:44 +0000 Subject: [PATCH 2/6] osx and windows builds --- .github/workflows/ci-scripts-build.yml | 13 +++++++++++++ devsupApp/src/Makefile | 1 + makehelper.py | 12 ++++++++---- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-scripts-build.yml b/.github/workflows/ci-scripts-build.yml index 6517e96..f985cd7 100644 --- a/.github/workflows/ci-scripts-build.yml +++ b/.github/workflows/ci-scripts-build.yml @@ -60,6 +60,18 @@ jobs: profile: latest test: yes + - os: macos-latest + base: "7.0" + python: "3.10" + profile: latest + test: yes + + - os: windows-latest + base: "7.0" + python: "3.10" + profile: latest + test: yes + - os: ubuntu-latest base: "3.15" python: "2.7" @@ -80,6 +92,7 @@ jobs: with: python-version: ${{ matrix.python }} - name: More Setup Python + shell: bash run: | python --version python -m pip --version diff --git a/devsupApp/src/Makefile b/devsupApp/src/Makefile index 9f1b468..de47406 100644 --- a/devsupApp/src/Makefile +++ b/devsupApp/src/Makefile @@ -29,6 +29,7 @@ _dbapi_SRCS += utest.c _dbapi_SRCS += pyDevSupCommon_registerRecordDeviceDriver.cpp _dbapi_LIBS += $(EPICS_BASE_IOC_LIBS) +_dbapi_SYS_LIBS_WIN32 += ws2_32 Advapi32 Dbghelp PY += devsup/__init__.py PY += devsup/db.py diff --git a/makehelper.py b/makehelper.py index ef36d63..c7ceeb5 100644 --- a/makehelper.py +++ b/makehelper.py @@ -14,7 +14,6 @@ from __future__ import print_function import sys -import errno import os if len(sys.argv)<2: @@ -26,7 +25,12 @@ pass out = open(sys.argv[1], 'w') -from distutils.sysconfig import get_config_var, get_python_inc +from sysconfig import get_config_var +try: + from distutils.sysconfig import get_python_inc +except ImportError: + def get_python_inc(): + return get_config_var('INCLUDEPY') or '' incdirs = [get_python_inc()] libdir = get_config_var('LIBDIR') or '' @@ -39,8 +43,8 @@ except ImportError: pass -print('TARGET_CFLAGS +=',get_config_var('BASECFLAGS'), file=out) -print('TARGET_CXXFLAGS +=',get_config_var('BASECFLAGS'), file=out) +print('TARGET_CFLAGS +=',get_config_var('BASECFLAGS') or '', file=out) +print('TARGET_CXXFLAGS +=',get_config_var('BASECFLAGS') or '', file=out) print('PY_VER :=',get_config_var('VERSION'), file=out) ldver = get_config_var('LDVERSION') From 6e2177daf3dddb0268a4a0716c5eadd25685cb62 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 13 Mar 2023 22:02:58 +0000 Subject: [PATCH 3/6] iocInit wrapper arguments hidden --- devsupApp/src/dbapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devsupApp/src/dbapi.c b/devsupApp/src/dbapi.c index 2dab153..f859cd6 100644 --- a/devsupApp/src/dbapi.c +++ b/devsupApp/src/dbapi.c @@ -278,7 +278,7 @@ static struct PyMethodDef dbapimethod[] = { "Execute IOC shell script or command"}, {"dbReadDatabase", (PyCFunction)py_dbReadDatabase, METH_VARARGS|METH_KEYWORDS, "Load EPICS database file"}, - {"iocInit", (PyCFunction)py_iocInit, METH_NOARGS, + {"iocInit", (PyCFunction)py_iocInit, METH_VARARGS|METH_KEYWORDS, "Initialize IOC"}, {"_dbd_setup", (PyCFunction)pyDBD_setup, METH_NOARGS, ""}, {"_dbd_rrd_base", (PyCFunction)py_pyDevSupCommon, METH_NOARGS, ""}, From e8061dfd69fc0dd6aba13380d8f187de446daf2e Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 13 Mar 2023 22:10:37 +0000 Subject: [PATCH 4/6] fixup! osx and windows builds --- .github/workflows/ci-scripts-build.yml | 7 +++++++ devsupApp/src/Makefile | 1 + makehelper.py | 8 ++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-scripts-build.yml b/.github/workflows/ci-scripts-build.yml index f985cd7..5843b63 100644 --- a/.github/workflows/ci-scripts-build.yml +++ b/.github/workflows/ci-scripts-build.yml @@ -102,6 +102,13 @@ jobs: EOF echo === configure/CONFIG_SITE.local === cat configure/CONFIG_SITE.local + - name: makehelper.py + run: python makehelper.py + - name: DSOs + shell: bash + run: find ${Python_ROOT_DIR} -name '*.dll' -o -name '*.so' -o -name '*.dylib' + - name: get_config_vars + run: python -c 'from sysconfig import get_config_vars; from pprint import pprint; pprint(get_config_vars())' - name: Prepare and compile dependencies run: python .ci/cue.py prepare - name: Build main module diff --git a/devsupApp/src/Makefile b/devsupApp/src/Makefile index de47406..4968e84 100644 --- a/devsupApp/src/Makefile +++ b/devsupApp/src/Makefile @@ -29,6 +29,7 @@ _dbapi_SRCS += utest.c _dbapi_SRCS += pyDevSupCommon_registerRecordDeviceDriver.cpp _dbapi_LIBS += $(EPICS_BASE_IOC_LIBS) +_dbapi_SYS_LIBS_WIN32 += python$(PY_LD_VER) _dbapi_SYS_LIBS_WIN32 += ws2_32 Advapi32 Dbghelp PY += devsup/__init__.py diff --git a/makehelper.py b/makehelper.py index c7ceeb5..ed0c0a0 100644 --- a/makehelper.py +++ b/makehelper.py @@ -33,7 +33,10 @@ def get_python_inc(): return get_config_var('INCLUDEPY') or '' incdirs = [get_python_inc()] -libdir = get_config_var('LIBDIR') or '' +libdirs = [ + get_config_var('LIBDIR') or get_config_var('LIBDEST') or '', + get_config_var('BINDIR') or '', +] have_np='NO' try: @@ -54,7 +57,8 @@ def get_python_inc(): ldver = ldver+'_d' print('PY_LD_VER :=',ldver, file=out) print('PY_INCDIRS :=',' '.join(incdirs), file=out) -print('PY_LIBDIRS :=',libdir, file=out) +print('PY_LIBDIRS :=',' '.join(libdirs), file=out) +print('PY_LDLIBS :=', get_config_var('BLDLIBRARY') or '', file=out) print('HAVE_NUMPY :=',have_np, file=out) try: From 93cd782ac682dcb092610ce58d042e5d09d28281 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Wed, 15 Mar 2023 10:30:49 +0000 Subject: [PATCH 5/6] shareLib.h --- devsupApp/src/dbdset.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/devsupApp/src/dbdset.c b/devsupApp/src/dbdset.c index 68d76e4..954d0c5 100644 --- a/devsupApp/src/dbdset.c +++ b/devsupApp/src/dbdset.c @@ -24,6 +24,7 @@ #include #include "pydevsup.h" +#include static int inshutdown; @@ -449,7 +450,8 @@ static long python_asub(aSubRecord* prec) } /* uglyness to detect aSubRecord */ -extern rset* pvar_rset_aSubRSET; +epicsShareExtern +rset* pvar_rset_aSubRSET; int isPyRecord(dbCommon *prec) { From 6be21d498734f9b45fcb5be8d53b7331312b85b5 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Thu, 16 Mar 2023 09:26:21 -0700 Subject: [PATCH 6/6] fixup! osx and windows builds --- .github/workflows/ci-scripts-build.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/ci-scripts-build.yml b/.github/workflows/ci-scripts-build.yml index 5843b63..c400628 100644 --- a/.github/workflows/ci-scripts-build.yml +++ b/.github/workflows/ci-scripts-build.yml @@ -15,70 +15,93 @@ jobs: runs-on: ${{ matrix.os }} # Set environment variables from matrix parameters env: + CMP: ${{ matrix.cmp }} + BCFG: ${{ matrix.configuration }} BASE: ${{ matrix.base }} PROF: ${{ matrix.profile }} EXTRA: ${{ matrix.extra }} TEST: ${{ matrix.test }} + VV: "1" strategy: fail-fast: false matrix: include: - os: ubuntu-latest + cmp: gcc + configuration: default base: "7.0" python: "2.7" profile: deb8 test: yes - os: ubuntu-latest + cmp: gcc + configuration: default base: "7.0" python: "2.7" profile: deb8 test: yes - os: ubuntu-latest + cmp: gcc + configuration: default base: "7.0" python: "3.7" profile: deb10 test: yes - os: ubuntu-latest + cmp: gcc + configuration: default base: "7.0" python: "3.8" profile: latest test: yes - os: ubuntu-latest + cmp: gcc + configuration: default base: "7.0" python: "3.9" profile: latest test: yes - os: ubuntu-latest + cmp: gcc + configuration: default base: "7.0" python: "3.10" profile: latest test: yes - os: macos-latest + cmp: gcc + configuration: default base: "7.0" python: "3.10" profile: latest test: yes - os: windows-latest + cmp: vs2019 + configuration: debug base: "7.0" python: "3.10" profile: latest test: yes - os: ubuntu-latest + cmp: gcc + configuration: default base: "3.15" python: "2.7" profile: deb8 test: yes - os: ubuntu-latest + cmp: gcc + configuration: default base: "3.14" python: "2.7" profile: deb8