diff --git a/.ci b/.ci index 899b183..4e4f33e 160000 --- a/.ci +++ b/.ci @@ -1 +1 @@ -Subproject commit 899b18336b4ce3bd9328fd30c33621224c78a4d7 +Subproject commit 4e4f33e54f59343c77342200a95800073661e7ac diff --git a/.github/workflows/ci-scripts-build.yml b/.github/workflows/ci-scripts-build.yml index 6729366..c46ce43 100644 --- a/.github/workflows/ci-scripts-build.yml +++ b/.github/workflows/ci-scripts-build.yml @@ -11,8 +11,9 @@ 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 }} @@ -33,6 +34,49 @@ jobs: base: "7.0" 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: "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" + container: "python:3.7" + profile: latest test: yes - os: ubuntu-latest @@ -59,6 +103,30 @@ jobs: 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 @@ -72,20 +140,31 @@ jobs: configuration: default base: "3.15" python: "3.7" + container: "python:3.7" profile: deb10 test: yes + - os: ubuntu-latest + cmp: gcc + configuration: default + base: "3.15" + python: "3.13" + profile: deb13 + test: yes + - os: ubuntu-latest cmp: gcc configuration: default base: "3.14" python: "3.7" + container: "python:3.7" profile: deb10 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 }} diff --git a/devsupApp/src/dbapi.c b/devsupApp/src/dbapi.c index f859cd6..ccbc69c 100644 --- a/devsupApp/src/dbapi.c +++ b/devsupApp/src/dbapi.c @@ -289,11 +289,11 @@ static struct PyMethodDef dbapimethod[] = { #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef dbapimodule = { - PyModuleDef_HEAD_INIT, + PyModuleDef_HEAD_INIT, "devsup._dbapi", NULL, -1, - &dbapimethod + dbapimethod }; #endif diff --git a/devsupApp/src/dbfield.c b/devsupApp/src/dbfield.c index 4a03cba..d909815 100644 --- a/devsupApp/src/dbfield.c +++ b/devsupApp/src/dbfield.c @@ -40,6 +40,16 @@ 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 +#ifndef NPY_CARRAY_RO + #define NPY_CARRAY_RO NPY_ARRAY_CARRAY_RO +#endif +#ifndef NPY_CARRAY + #define NPY_CARRAY NPY_ARRAY_CARRAY +#endif #endif typedef struct { @@ -98,7 +108,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); 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-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-latest.txt b/requirements-latest.txt index 99ce0ab..5b989fd 100644 --- a/requirements-latest.txt +++ b/requirements-latest.txt @@ -1,2 +1,2 @@ -numpy +numpy>=1.18 nose2