diff --git a/.ci b/.ci index 1e0e326..0e93b70 160000 --- a/.ci +++ b/.ci @@ -1 +1 @@ -Subproject commit 1e0e326f74ffac4154ce80b5d41c410c754cf5d8 +Subproject commit 0e93b708551cb7bb212fda7029eccdf872dabc81 diff --git a/.github/workflows/ci-scripts-build.yml b/.github/workflows/ci-scripts-build.yml index f77157b..d00a59e 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 @@ -11,65 +11,161 @@ env: jobs: build-base: - name: ${{ matrix.base }}/${{ matrix.os }}/${{ matrix.python }}/${{ matrix.extra }} + name: ${{ matrix.base }}/${{ matrix.os }}/${{ matrix.profile }}/${{ matrix.python }}/${{ matrix.extra }} runs-on: ${{ matrix.os }} + container: ${{ matrix.container }} # 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 + python: "3.7" + profile: deb10 + container: "python:3.7" + test: yes + + - os: ubuntu-latest + cmp: gcc + configuration: default + base: "7.0" + python: "3.9" + profile: deb11 + test: yes + + - os: ubuntu-latest + cmp: gcc + configuration: default + base: "7.0" + python: "3.11" + profile: deb12 test: yes - os: ubuntu-latest + cmp: gcc + configuration: default base: "7.0" - python: "2.7" - profile: deb8 + python: "3.13" + profile: deb13 test: yes - os: ubuntu-latest + cmp: gcc + configuration: default + base: "7.0" + python: "3.6" + container: "python:3.6" + profile: latest + test: yes + + - os: ubuntu-latest + cmp: gcc + configuration: default base: "7.0" python: "3.7" - profile: deb10 + container: "python:3.7" + profile: latest 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: ubuntu-latest + cmp: gcc + configuration: default + base: "7.0" + python: "3.11" + profile: latest + test: yes + + - os: ubuntu-latest + cmp: gcc + configuration: default + base: "7.0" + python: "3.12" + profile: latest + test: yes + + - os: ubuntu-latest + cmp: gcc + configuration: default + base: "7.0" + python: "3.13" + profile: latest + test: yes + + - os: macos-latest + cmp: gcc + configuration: default + 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 + python: "3.7" + container: "python:3.7" + profile: deb10 test: yes - os: ubuntu-latest - base: "3.14" - python: "2.7" - profile: deb8 + cmp: gcc + configuration: default + base: "3.15" + python: "3.13" + profile: deb13 + test: yes + #- os: ubuntu-latest + # cmp: gcc + # configuration: default + # base: "3.14" # RuntimeError: Requires Base >=3.15 ?? + # python: "3.7" + # container: "python:3.7" + # profile: deb10 + # test: yes steps: - uses: actions/checkout@v3 with: submodules: true - name: Set up Python ${{ matrix.python }} + if: ${{ !matrix.container }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} @@ -83,6 +179,8 @@ jobs: EOF echo === configure/CONFIG_SITE.local === cat configure/CONFIG_SITE.local + - name: Python sysconfig + run: python -m sysconfig - 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 3a26547..8e4ff2d 100644 --- a/devsupApp/src/Makefile +++ b/devsupApp/src/Makefile @@ -31,6 +31,9 @@ _dbapi_SRCS += pyDevSupCommon_registerRecordDeviceDriver.cpp _dbapi_LIBS += $(EPICS_BASE_IOC_LIBS) PY += devsup/__init__.py +PY += devsup/_dbapi.dbd +PY += devsup/_int64.dbd +PY += devsup/_lsilso.dbd PY += devsup/db.py PY += devsup/dset.py PY += devsup/hooks.py @@ -61,7 +64,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/devsupApp/src/dbapi.c b/devsupApp/src/dbapi.c index 2dab153..1b2fb85 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, ""}, @@ -289,7 +289,7 @@ static struct PyMethodDef dbapimethod[] = { #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef dbapimodule = { - PyModuleDef_HEAD_INIT, + PyModuleDef_HEAD_INIT, "devsup._dbapi", NULL, -1, diff --git a/devsupApp/src/dbfield.c b/devsupApp/src/dbfield.c index 4a03cba..b99fbde 100644 --- a/devsupApp/src/dbfield.c +++ b/devsupApp/src/dbfield.c @@ -40,6 +40,10 @@ static const int dbf2np_map[DBF_MENU+1] = { NPY_INT16, // DBF_MENU }; static PyArray_Descr* dbf2np[DBF_MENU+1]; +#if NPY_ABI_VERSION < 0x02000000 + #define PyDataType_ELSIZE(descr) ((descr)->elsize) + #define PyDataType_SET_ELSIZE(descr, size) (descr)->elsize = size +#endif #endif typedef struct { @@ -98,7 +102,7 @@ static PyObject* build_array(PyObject* obj, void *data, unsigned short ftype, un desc = dbf2np[ftype]; if(ftype==DBF_STRING) { - desc->elsize = MAX_STRING_SIZE; + PyDataType_SET_ELSIZE(desc, MAX_STRING_SIZE); } Py_XINCREF(desc); @@ -114,23 +118,26 @@ static int assign_array(DBADDR *paddr, PyObject *arr) #ifdef HAVE_NUMPY void *rawfield = paddr->pfield; rset *prset; - PyObject *aval; + 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(arr)!=2 || PyArray_DIM(arr,0)>maxlen || PyArray_DIM(arr,1)!=MAX_STRING_SIZE)) + (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"); return 1; - } else if(PyArray_NDIM(arr)!=1 || PyArray_DIM(arr,0)>maxlen) { + } else if(PyArray_NDIM(array)!=1 || PyArray_DIM(array,0)>maxlen) { PyErr_Format(PyExc_ValueError, "Array has incorrect shape or is too large"); return 1; } - insize = PyArray_DIM(arr, 0); + insize = PyArray_DIM(array, 0); if(paddr->special==SPC_DBADDR && (prset=dbGetRset(paddr)) && @@ -152,7 +159,7 @@ static int assign_array(DBADDR *paddr, PyObject *arr) } Py_XINCREF(desc); - if(!(aval = PyArray_FromAny(arr, desc, 1, 2, NPY_CARRAY, arr))) + if(!(aval = PyArray_FromAny(arr, desc, 1, 2, NPY_ARRAY_C_CONTIGUOUS | NPY_ARRAY_ALIGNED | NPY_ARRAY_WRITEABLE, arr))) return 1; if(elemsize!=PyArray_ITEMSIZE(aval)) { @@ -207,7 +214,7 @@ static PyObject* pyField_getval(pyField *self) if(self->addr.no_elements>1) { return build_array((PyObject*)self, rawfield, self->addr.field_type, - noe, NPY_CARRAY_RO); + noe, NPY_ARRAY_C_CONTIGUOUS | NPY_ARRAY_ALIGNED); } } @@ -296,8 +303,8 @@ static PyObject* pyField_putval(pyField *self, PyObject* args) OP(LONG, epicsInt32, PyInt_AsLong); OP(ULONG, epicsUInt32, PyInt_AsLong); #ifdef HAVE_INT64 - OP(INT64, epicsInt32, PyLong_AsLongLong); - OP(UINT64, epicsUInt32, PyLong_AsLongLong); + OP(INT64, epicsInt64, PyLong_AsLongLong); + OP(UINT64, epicsUInt64, PyLong_AsLongLong); #endif OP(FLOAT, epicsFloat32,PyFloat_AsDouble); OP(DOUBLE,epicsFloat64,PyFloat_AsDouble); @@ -314,11 +321,14 @@ static PyObject* pyField_putval(pyField *self, PyObject* args) fld = PyString_AsString(val); #endif if(fld) { - strncpy(dest, fld, MAX_STRING_SIZE); - dest[MAX_STRING_SIZE-1]='\0'; + strncpy(dest, fld, self->addr.field_size); + dest[self->addr.field_size-1]='\0'; } else { dest[0] = '\0'; } + if ((self->addr.special == SPC_MOD) || (self->addr.special == SPC_NOMOD)) + if (prset = dbGetRset(&self->addr)) + prset->special(&self->addr, 1); #if PY_MAJOR_VERSION >= 3 Py_DECREF(data); #endif @@ -362,7 +372,7 @@ static PyObject *pyField_getarray(pyField *self) } else data = self->addr.pfield; - return build_array((PyObject*)self, data, self->addr.field_type, self->addr.no_elements, NPY_CARRAY); + return build_array((PyObject*)self, data, self->addr.field_type, self->addr.no_elements, NPY_ARRAY_C_CONTIGUOUS | NPY_ARRAY_ALIGNED | NPY_ARRAY_WRITEABLE); } static PyObject *pyField_getlen(pyField *self) diff --git a/devsupApp/src/devsup/__init__.py b/devsupApp/src/devsup/__init__.py index dd8da5a..d9a01b5 100644 --- a/devsupApp/src/devsup/__init__.py +++ b/devsupApp/src/devsup/__init__.py @@ -45,39 +45,28 @@ __all__ = [] + +def epics_version_int(): + return (EPICS_VERSION, EPICS_REVISION, EPICS_MODIFICATION, EPICS_PATCH_LEVEL) + def _init(iocMain=False): if not iocMain: # we haven't read/register base.dbd _dbapi.dbReadDatabase(os.path.join(XEPICS_BASE, "dbd", "base.dbd"), path=os.path.join(XEPICS_BASE, "dbd")) _dbapi._dbd_rrd_base() - - with tempfile.NamedTemporaryFile() as F: - F.write(""" -device(longin, INST_IO, pydevsupComIn, "Python Device") -device(longout, INST_IO, pydevsupComOut, "Python Device") - -device(ai, INST_IO, pydevsupComIn, "Python Device") -device(ao, INST_IO, pydevsupComOut, "Python Device") - -device(stringin, INST_IO, pydevsupComIn, "Python Device") -device(stringout, INST_IO, pydevsupComOut, "Python Device") - -device(bi, INST_IO, pydevsupComIn, "Python Device") -device(bo, INST_IO, pydevsupComOut, "Python Device") - -device(mbbi, INST_IO, pydevsupComIn, "Python Device") -device(mbbo, INST_IO, pydevsupComOut, "Python Device") - -device(mbbiDirect, INST_IO, pydevsupComIn, "Python Device") -device(mbboDirect, INST_IO, pydevsupComOut, "Python Device") - -device(waveform, INST_IO, pydevsupComIn, "Python Device") -device(aai, INST_IO, pydevsupComIn, "Python Device") -device(aao, INST_IO, pydevsupComOut, "Python Device") -""".encode('ascii')) - F.flush() - _dbapi.dbReadDatabase(F.name) + + dirname = os.path.dirname(__file__) + dbd_name = dirname + "/_dbapi.dbd" + _dbapi.dbReadDatabase(dbd_name) + if epics_version_int() >= (3, 15, 0, 2): + # Long strings are impletemented. + dbd_name = dirname + "/_lsilso.dbd" + _dbapi.dbReadDatabase(dbd_name) + if epics_version_int() >= (3, 16, 1, 0): + # Long ints are impletemented. + dbd_name = dirname + "/_int64.dbd" + _dbapi.dbReadDatabase(dbd_name) _dbapi._dbd_setup() def _fini(iocMain=False): diff --git a/devsupApp/src/devsup/_dbapi.dbd b/devsupApp/src/devsup/_dbapi.dbd new file mode 100644 index 0000000..0d791aa --- /dev/null +++ b/devsupApp/src/devsup/_dbapi.dbd @@ -0,0 +1,22 @@ + +device(longin, INST_IO, pydevsupComIn, "Python Device") +device(longout, INST_IO, pydevsupComOut, "Python Device") + +device(ai, INST_IO, pydevsupComIn, "Python Device") +device(ao, INST_IO, pydevsupComOut, "Python Device") + +device(stringin, INST_IO, pydevsupComIn, "Python Device") +device(stringout, INST_IO, pydevsupComOut, "Python Device") + +device(bi, INST_IO, pydevsupComIn, "Python Device") +device(bo, INST_IO, pydevsupComOut, "Python Device") + +device(mbbi, INST_IO, pydevsupComIn, "Python Device") +device(mbbo, INST_IO, pydevsupComOut, "Python Device") + +device(mbbiDirect, INST_IO, pydevsupComIn, "Python Device") +device(mbboDirect, INST_IO, pydevsupComOut, "Python Device") + +device(waveform, INST_IO, pydevsupComIn, "Python Device") +device(aai, INST_IO, pydevsupComIn, "Python Device") +device(aao, INST_IO, pydevsupComOut, "Python Device") diff --git a/devsupApp/src/devsup/_int64.dbd b/devsupApp/src/devsup/_int64.dbd new file mode 100644 index 0000000..120fb64 --- /dev/null +++ b/devsupApp/src/devsup/_int64.dbd @@ -0,0 +1,2 @@ +device(int64in, INST_IO, pydevsupComIn, "Python Device") +device(int64out, INST_IO, pydevsupComOut, "Python Device") diff --git a/devsupApp/src/devsup/_lsilso.dbd b/devsupApp/src/devsup/_lsilso.dbd new file mode 100644 index 0000000..761ef5b --- /dev/null +++ b/devsupApp/src/devsup/_lsilso.dbd @@ -0,0 +1,2 @@ +device(lsi, INST_IO, pydevsupComIn, "Python Device") +device(lso, INST_IO, pydevsupComOut, "Python Device") \ No newline at end of file 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/devsupApp/src/devsup/test/test_db.py b/devsupApp/src/devsup/test/test_db.py index 2dc33e0..cc8ec89 100644 --- a/devsupApp/src/devsup/test/test_db.py +++ b/devsupApp/src/devsup/test/test_db.py @@ -2,13 +2,14 @@ import os import unittest import tempfile +import time import numpy from numpy.testing import assert_array_almost_equal, assert_array_equal from ..db import getRecord from .. import _dbapi -from .. import _init +from .. import _init, epics_version_int from .util import IOCHelper @@ -129,6 +130,87 @@ def test_wf_string(self): assert_array_equal(rec.VAL, numpy.asarray(["zero", "", "one", "This is a really long string which shoul", "", "last"], dtype='S40')) +class TestLongStringField(IOCHelper): + db = """ + record(lsi, "rec:lsi") { + field(SIZV, 128) + field(SCAN, "I/O Intr") + } + record(lso, "rec:lso") { + field(SIZV, 128) + field(DOL, "rec:lsi.VAL$") + field(OMSL, "closed_loop") + } + """ + if epics_version_int() < (3, 15, 0, 2): + # Long strings not impletemented yet. + db = None + + def test_lsilso(self): + if epics_version_int() < (3, 15, 0, 2): + # Long strings not impletemented yet. + return + + lsi = getRecord("rec:lsi") + lso = getRecord("rec:lso") + + with lsi: + self.assertEqual(lsi.VAL, "") + + lsi.VAL = "test" + self.assertEqual(lsi.VAL, "test") + + lsi.VAL = "" + self.assertEqual(lsi.VAL, "") + + # does not truncate + lsi.VAL = "This is a really long string which should NOT be truncated" + self.assertEqual(lsi.VAL, "This is a really long string which should NOT be truncated") + + lso.scan() + time.sleep(0.01) # The linked value needs a small amount of time to update. + + with lso: + self.assertEqual(lso.VAL, lsi.VAL) + +class TestInt64Field(IOCHelper): + db = """ + record(int64in, "rec:in64") { + field(SCAN, "I/O Intr") + } + record(int64out, "rec:out64") { + field(DOL, "rec:in64.VAL") + field(OMSL, "closed_loop") + } + """ + if epics_version_int() < (3, 16, 1, 0): + # Long ints not impletemented yet. + db = None + + def testint64(self): + if epics_version_int() < (3, 16, 1, 0): + # Long ints not impletemented yet. + return + in64 = getRecord("rec:in64") + out64 = getRecord("rec:out64") + + with in64: + self.assertEqual(in64.VAL, 0) + + in64.VAL = 42 + self.assertEqual(in64.VAL, 42) + + in64.VAL = 0x7FFFFFFFFFFFFFFE + self.assertEqual(in64.VAL, 0x7FFFFFFFFFFFFFFE) + + in64.VAL = 0x7FFFFFFFFFFFFFFF + self.assertEqual(in64.VAL, 0x7FFFFFFFFFFFFFFF) + + out64.scan() + time.sleep(0.01) # The linked value needs a small amount of time to update. + + with out64: + self.assertEqual(out64.VAL, in64.VAL) class TestDset(IOCHelper): db = """ diff --git a/documentation/environment.rst b/documentation/environment.rst index a33677b..076d7cb 100644 --- a/documentation/environment.rst +++ b/documentation/environment.rst @@ -4,7 +4,7 @@ Runtime Environment The pyDevSup module initializes the interpreter during the registration phase of IOC startup with the *pySetupReg* registrar function. :: - #!../../bin/linux-x86_64/softIocPy2.7 + #!../../bin/linux-x86_64/softIocPy3.6 # Interpreter not started dbLoadDatabase("../../dbd/softIocPy.dbd",0,0) softIocPy_registerRecordDeviceDriver(pdbbase) @@ -51,7 +51,7 @@ file. :: The default or preferred Python version can be specificed in *configure/CONFIG_SITE* :: - PY_VER ?= 2.7 + PY_VER ?= 3.6 The following should be added to individual EPICS Makefiles. :: @@ -64,8 +64,8 @@ The following should be added to individual EPICS Makefiles. :: This will add or amend several make variables. The ``USR_*FLAGS`` variables may be extended with appropriate flags for building python modules. The ``PY_VER`` -variable is defined with the Python version number found in install directories (eg "2.7"). -The ``PY_LD_VER`` variable is defined with the python library version number (eg "3.2mu"), +variable is defined with the Python version number found in install directories (eg "3.6"). +The ``PY_LD_VER`` variable is defined with the python library version number (eg "3.6mu"), which may be the same as ``PY_VER``. Include pyDevSup in your IOC @@ -113,11 +113,11 @@ Installing for several Python versions The recipe for building and installing the pyDevSup module for several python version side by side is :: - make PY_VER=2.6 + make PY_VER=3.6 make clean - make PY_VER=2.7 + make PY_VER=3.10 make clean - make PY_VER=3.2 + make PY_VER=3.14 make clean The ``PYTHON`` make variable can be specified if the interpreter executable diff --git a/documentation/gettingstarted.rst b/documentation/gettingstarted.rst index ef542ef..294494a 100644 --- a/documentation/gettingstarted.rst +++ b/documentation/gettingstarted.rst @@ -24,7 +24,7 @@ The :py:meth:`process ` method increments the *VAL* field Start this IOC with. :: - $ ./bin/linux-x86_64/softIocPy2.7 -d cntrec.db + $ ./bin/linux-x86_64/softIocPy3.6 -d cntrec.db Starting iocInit ... iocRun: All initialization complete diff --git a/documentation/index.rst b/documentation/index.rst index 2acf7b1..ec7ae61 100644 --- a/documentation/index.rst +++ b/documentation/index.rst @@ -8,7 +8,7 @@ pydevsup documentation *pyDevSup* is a means of writing EPICS device support code in Python. -It currently supports EPICS >=3.14.12 and python versions: 2.7, and >=3.2. +It currently supports EPICS >=3.15 and python versions: >=3.6 The numpy package is also required. The source can be found at http://github.com/mdavidsaver/pyDevSup diff --git a/iocBoot/iocapplmon/st.cmd b/iocBoot/iocapplmon/st.cmd index c931fb9..f345464 100755 --- a/iocBoot/iocapplmon/st.cmd +++ b/iocBoot/iocapplmon/st.cmd @@ -1,4 +1,4 @@ -#!../../bin/linux-x86/softIocPy2.7 +#!../../bin/linux-x86_64/softIocPy3.6 < envPaths diff --git a/iocBoot/iocarchivemon/st.cmd b/iocBoot/iocarchivemon/st.cmd index 20fef52..632e7a6 100755 --- a/iocBoot/iocarchivemon/st.cmd +++ b/iocBoot/iocarchivemon/st.cmd @@ -1,4 +1,4 @@ -#!../../bin/linux-x86/softIocPy2.7 +#!../../bin/linux-x86_64/softIocPy3.6 < envPaths diff --git a/iocBoot/iocarchivemon/st.cmd.main b/iocBoot/iocarchivemon/st.cmd.main index df00b9c..ea10a94 100755 --- a/iocBoot/iocarchivemon/st.cmd.main +++ b/iocBoot/iocarchivemon/st.cmd.main @@ -1,4 +1,4 @@ -#!../../bin/linux-x86_64/softIocPy2.7 +#!../../bin/linux-x86_64/softIocPy3.6 < envPaths diff --git a/makehelper.py b/makehelper.py index ef36d63..05fd147 100644 --- a/makehelper.py +++ b/makehelper.py @@ -26,15 +26,30 @@ pass out = open(sys.argv[1], 'w') -from distutils.sysconfig import get_config_var, get_python_inc +""" +3.2 sysconfig +3.10 sysconfig.get_path +3.10.13 distutils is deprecated. +3.12 distutils was removed. +""" +if sys.version_info >= (3,10,): + from sysconfig import get_config_var, get_path + incdirs = [get_path("include")] +else: + from distutils.sysconfig import get_config_var, get_python_inc + incdirs = [get_python_inc()] -incdirs = [get_python_inc()] libdir = get_config_var('LIBDIR') or '' have_np='NO' + +""" +numpy 1.18, numpy.get_include() +""" try: - from numpy.distutils.misc_util import get_numpy_include_dirs - incdirs = get_numpy_include_dirs()+incdirs + from numpy import get_include + numpy_dir = [get_include()] + incdirs = numpy_dir+incdirs have_np='YES' except ImportError: pass diff --git a/requirements-deb10.txt b/requirements-deb10.txt index 382bf56..039a17d 100644 --- a/requirements-deb10.txt +++ b/requirements-deb10.txt @@ -1,2 +1,2 @@ numpy==1.16.2 -nose==1.3.7 +nose2 diff --git a/requirements-deb11.txt b/requirements-deb11.txt new file mode 100644 index 0000000..bc9b6d9 --- /dev/null +++ b/requirements-deb11.txt @@ -0,0 +1,2 @@ +numpy==1.19.5 +nose2==0.9.2 diff --git a/requirements-deb12.txt b/requirements-deb12.txt new file mode 100644 index 0000000..13118a8 --- /dev/null +++ b/requirements-deb12.txt @@ -0,0 +1,2 @@ +numpy==1.24.2 +nose2==0.12.0 diff --git a/requirements-deb13.txt b/requirements-deb13.txt new file mode 100644 index 0000000..abb51c7 --- /dev/null +++ b/requirements-deb13.txt @@ -0,0 +1,2 @@ +numpy==2.2.4 +nose2==0.15.1 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