From c16f2301e38b07eda9f62fa484ea8e3ea90a9321 Mon Sep 17 00:00:00 2001 From: Jan Kotanski Date: Thu, 11 Apr 2024 13:14:10 +0200 Subject: [PATCH 1/5] add 24.04 tests --- .ci/ubuntu24.04_py3/Dockerfile | 44 ++++++++++++++++++++++++++++++++++ .github/workflows/tests.yml | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 .ci/ubuntu24.04_py3/Dockerfile diff --git a/.ci/ubuntu24.04_py3/Dockerfile b/.ci/ubuntu24.04_py3/Dockerfile new file mode 100644 index 0000000..48ba081 --- /dev/null +++ b/.ci/ubuntu24.04_py3/Dockerfile @@ -0,0 +1,44 @@ +FROM ubuntu:24.04 + +MAINTAINER DESY, Jan Kotanski + + +RUN apt-get update +RUN apt-get install -y base-passwd apt-utils dialog -y +RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections +RUN apt-get -qq update && apt-get -qq install -y libterm-readline-gnu-perl software-properties-common coreutils gnupg2 procps curl apt-transport-https gnupg2 ca-certificates wget gpg-agent + +RUN curl -s http://repos.pni-hdri.de/debian_repo.pub.gpg | gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/debian-hdri-repo.gpg --import +RUN chmod 644 /etc/apt/trusted.gpg.d/debian-hdri-repo.gpg +RUN cd /etc/apt/sources.list.d && wget http://repos.pni-hdri.de/noble-pni-hdri.list + +RUN apt-get -qq update && export DEBIAN_FRONTEND=noninteractive && apt-get -qq dist-upgrade +RUN apt-get -qq update && export DEBIAN_FRONTEND=noninteractive && apt-get -qq install -y python3-sphinx apt-utils net-tools +RUN apt-get -qq install -y libpninexus3.2.0-dev libpninexus3.2.0 libh5cpp0.6.0-dev libh5cpp0.6.0 python3-numpy libhdf5-dev libboost-regex-dev libboost-program-options-dev libboost-system-dev libboost-date-time-dev libboost-filesystem-dev libblas-dev libatlas-base-dev cython3 python3-setuptools libboost-python-dev python3-numpy-abi9 g++ python3-h5py +RUN apt-get -qq install -y hdf5-filter-plugin hdf5-plugin-bshuf python3-pytest git cmake doxygen python3-sphinx libboost-all-dev +RUN useradd -ms /bin/bash tango + +# # install latest h5cpp +# RUN mkdir -p /opt/h5cpp +# RUN mkdir -p /h5cpp-src +# RUN cd /h5cpp-src && git clone https://github.com/ess-dmsc/h5cpp && mkdir build +# RUN cd /h5cpp-src/build && cmake -DCMAKE_INSTALL_PREFIX=/opt/h5cpp -DCMAKE_BUILD_TYPE=Release -DH5CPP_CONAN=DISABLE -DH5CPP_DISABLE_TESTS=True ../h5cpp && make install -j4 +# ENV CPLUS_INCLUDE_PATH=/opt/h5cpp/include +# ENV LD_LIBRARY_PATH=/opt/h5cpp/lib +# ENV H5CPP=/opt/h5cpp/lib/cmake/h5cpp-0.5 +# ENV H5CPP_LOCAL_PATH=/opt/h5cpp +# ENV HDF5_HL_LOCAL_PATH=/usr/lib/x86_64-linux-gnu/hdf5/serial/ + +# # # install latest linpninexus +# RUN mkdir -p /opt/libpninexus +# RUN mkdir -p /libpninexus-src +# RUN cd /libpninexus-src && git clone https://github.com/pni-libraries/libpninexus && mkdir build +# # RUN cd /libpninexus-src/build && cmake -Dh5cpp_DIR=$H5CPP -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/h5cpp/ -DPNINEXUS_CONAN=DISABLE ../libpninexus && make -j4 && make install -j4 +# RUN cd /libpninexus-src/build && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/libpninexus/ -DPNINEXUS_CONAN=DISABLE ../libpninexus && make -j4 && make install -j4 +# ENV CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/opt/libpninexus/include +# ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/libpninexus/lib +# ENV PNINEXUS_LOCAL_PATH=/opt/libpninexus + +ENV PKG_CONFIG_PATH=/home/tango/lib/pkgconfig +USER tango +WORKDIR /home/tango diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5bbb680..525a724 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - os: [debian12, debian11, debian10, ubuntu23.10, ubuntu22.04, ubuntu20.04] + os: [debian12, debian11, debian10, ubuntu24.04, ubuntu22.04, ubuntu20.04] steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 From 32df360aced8a4267159b9162ab111c2667c56e8 Mon Sep 17 00:00:00 2001 From: Jan Kotanski Date: Thu, 11 Apr 2024 14:18:00 +0200 Subject: [PATCH 2/5] change PyUnicode_GET_DATA_SIZE to PyUnicode_GET_LENGTH --- setup.py | 6 +++--- src/cpp/nexus/element_dict_converter.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 5dc61a6..a257b41 100644 --- a/setup.py +++ b/setup.py @@ -20,9 +20,9 @@ BuildDoc = None name = "pninexus" -version = "3.2.2" -# release = "3.2.2" -release = "3.2" +version = "3.2.3" +release = "3.2.3" +# release = "3.2" if release.count(".") == 1: docs_release = '(latest)' diff --git a/src/cpp/nexus/element_dict_converter.cpp b/src/cpp/nexus/element_dict_converter.cpp index 74d50dd..15aae96 100644 --- a/src/cpp/nexus/element_dict_converter.cpp +++ b/src/cpp/nexus/element_dict_converter.cpp @@ -92,7 +92,7 @@ void* dict_to_nxpath_element_converter::convertible(PyObject *obj_ptr) string get_string_from_pyobject(PyObject *ptr) { #if PY_MAJOR_VERSION >= 3 - Py_ssize_t str_size = PyUnicode_GET_DATA_SIZE(ptr); + Py_ssize_t str_size = PyUnicode_GET_LENGTH(ptr); if(str_size) { PyObject *utf8_str = PyUnicode_AsUTF8String(ptr); From 3347a14c0686074289b5fa07d7ca49d489a72919 Mon Sep 17 00:00:00 2001 From: Jan Kotanski Date: Thu, 11 Apr 2024 14:29:04 +0200 Subject: [PATCH 3/5] update docu --- CHANGELOG.md | 3 +++ doc/sphinx/conf.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f06de44..9b23503 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # ChangeLog +## 3.2.3 - 2023-04-11 +- adapt code to python 3.12 ([#196](https://github.com/pni-libraries/python-pninexus/pull/201)) + ## 3.2.2 - 2023-10-12 - add pninexus filters to python wheel ([#196](https://github.com/pni-libraries/python-pninexus/pull/196)) diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py index 3d2d194..c8a18dc 100644 --- a/doc/sphinx/conf.py +++ b/doc/sphinx/conf.py @@ -160,7 +160,7 @@ html_context = { "docs_versions" : [ - "v3.2.2", "v3.2.1", "v3.2.0", "v3.1.0", + "v3.2.3", "v3.2.2", "v3.2.1", "v3.2.0", "v3.1.0", "v3.0.3", "v3.0.2", "v3.0.1", "v3.0.0", "v2.0.0", "v1.3.4"] } From 6d108bedc59c1f03c8c36b329050922daa724da7 Mon Sep 17 00:00:00 2001 From: Jan Kotanski Date: Thu, 11 Apr 2024 15:10:49 +0200 Subject: [PATCH 4/5] update doc build --- .ci/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/install.sh b/.ci/install.sh index 226889a..5901827 100755 --- a/.ci/install.sh +++ b/.ci/install.sh @@ -18,7 +18,7 @@ else docker exec --user root ndts python3 setup.py install if [ "$?" != "0" ]; then exit 255; fi echo "build python3-pninexus docs" - docker exec ndts python3 setup.py build_sphinx + docker exec ndts sphinx-build doc/sphinx/ build/sphinx/html fi if [ "$?" != "0" ]; then exit 255; fi From f0feba9215eecb40b939e6485c5f7abc35ebda62 Mon Sep 17 00:00:00 2001 From: Jan Kotanski Date: Thu, 11 Apr 2024 15:23:51 +0200 Subject: [PATCH 5/5] add python 3.12 label --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index a257b41..eafff49 100644 --- a/setup.py +++ b/setup.py @@ -278,6 +278,7 @@ def run(self): 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', ], test_suite="test", test_loader="unittest:TestLoader",