From 425ac1f84d7d15b0aaaaa1af25a7c794b6e0b161 Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Mon, 21 Oct 2024 16:01:49 +0200 Subject: [PATCH] Sync --- .ci_support/run_docker_linux.sh | 4 ++-- .ci_support/run_docker_mingw.sh | 7 +++---- CMakeLists.txt | 18 +++++++----------- VERSION | 2 +- distro/debian/changelog | 2 +- distro/rpm/otmixmod.spec | 2 +- python/doc/conf.py.in | 10 ++++++++-- python/src/__init__.py | 2 +- 8 files changed, 24 insertions(+), 23 deletions(-) diff --git a/.ci_support/run_docker_linux.sh b/.ci_support/run_docker_linux.sh index 77ed331..c121cbc 100755 --- a/.ci_support/run_docker_linux.sh +++ b/.ci_support/run_docker_linux.sh @@ -5,10 +5,10 @@ set -xe cd /tmp mkdir build && cd build cmake -DCMAKE_INSTALL_PREFIX=~/.local \ - -DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=32 \ + -DCMAKE_UNITY_BUILD=ON \ -DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Wshadow -Werror -D_GLIBCXX_ASSERTIONS" \ -DSWIG_COMPILE_FLAGS="-O1 -Wno-unused-parameter -Wno-shadow" \ - -DSPHINX_FLAGS="-W -T -j4" \ + -DUSE_SPHINX=ON -DSPHINX_FLAGS="-W -T -j4" \ /io make install make tests diff --git a/.ci_support/run_docker_mingw.sh b/.ci_support/run_docker_mingw.sh index 7a700b2..2c8d542 100755 --- a/.ci_support/run_docker_mingw.sh +++ b/.ci_support/run_docker_mingw.sh @@ -8,15 +8,14 @@ mkdir build && cd build PREFIX=${PWD}/install CXXFLAGS="-Wall -Wextra -D_GLIBCXX_ASSERTIONS" ${ARCH}-w64-mingw32-cmake \ -DCMAKE_INSTALL_PREFIX=${PREFIX} \ + -DCMAKE_UNITY_BUILD=ON \ -DPython_INCLUDE_DIR=${MINGW_PREFIX}/include/python${PYMAJMIN} \ -DPython_LIBRARY=${MINGW_PREFIX}/lib/libpython${PYMAJMIN}.dll.a \ -DPython_EXECUTABLE=/usr/bin/${ARCH}-w64-mingw32-python${PYMAJMIN}-bin \ - -DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=32 \ - -DBUILD_DOC=OFF \ /io make install ${ARCH}-w64-mingw32-strip --strip-unneeded ${PREFIX}/bin/*.dll ${PREFIX}/Lib/site-packages/*/*.pyd echo lib/test ${PREFIX}/Lib/site-packages/* | xargs -n 1 cp ${PREFIX}/bin/*.dll -ctest -R pyinstallcheck --output-on-failure --timeout 1000 --schedule-random ${MAKEFLAGS} +OPENTURNS_NUM_THREADS=2 ctest -R pyinstallcheck --output-on-failure --timeout 1000 --schedule-random ${MAKEFLAGS} make tests -ctest -R cppcheck --output-on-failure --timeout 1000 --schedule-random ${MAKEFLAGS} +OPENTURNS_NUM_THREADS=2 ctest -R cppcheck --output-on-failure --timeout 1000 --schedule-random ${MAKEFLAGS} diff --git a/CMakeLists.txt b/CMakeLists.txt index 9cc7c03..5a6c083 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 3.13) option (BUILD_PYTHON "Build the python module for the library" ON) -option (USE_SPHINX "Use sphinx for documentation" ON) +option (USE_SPHINX "Use sphinx for documentation" OFF) option (BUILD_SHARED_LIBS "Build shared libraries" ON) # By default, build in Release mode. Must appear before project() command @@ -29,9 +29,6 @@ endif() find_package (OpenTURNS CONFIG REQUIRED) message (STATUS "Found OpenTURNS: ${OPENTURNS_ROOT_DIR} (found version \"${OPENTURNS_VERSION_STRING}\")") -if (NOT DEFINED OPENTURNS_PYTHON_MODULE_PATH) - set (OPENTURNS_PYTHON_MODULE_PATH ${OPENTURNS_PYTHON3_MODULE_PATH}) -endif () find_package (Mixmod REQUIRED) @@ -54,16 +51,14 @@ set (OTMIXMOD_DATA_PATH ${CMAKE_INSTALL_DATAROOTDIR}) set (OTMIXMOD_CONFIG_CMAKE_PATH ${CMAKE_INSTALL_LIBDIR}/cmake/otmixmod) set (OTMIXMOD_DOC_PATH ${CMAKE_INSTALL_DOCDIR}) -set (CMAKE_CXX_STANDARD 11) - if (BUILD_PYTHON) find_package (SWIG 3) include (${SWIG_USE_FILE}) - if (CMAKE_VERSION VERSION_LESS 3.24) - find_package (Python 3.5 COMPONENTS Interpreter Development) + if (CMAKE_VERSION VERSION_LESS 3.28) + find_package (Python 3.6 COMPONENTS Interpreter Development) else () - find_package (Python 3.5 COMPONENTS Interpreter Development.Module) + find_package (Python 3.6 COMPONENTS Interpreter Development.Module Development.SABIModule) endif () if (Python_FOUND) @@ -77,7 +72,8 @@ if (BUILD_PYTHON) find_program (SPHINX_EXECUTABLE NAMES sphinx-build DOC "Sphinx Documentation Builder (sphinx-doc.org)") find_python_module (numpydoc) find_python_module (sphinx_gallery) - if (SPHINX_EXECUTABLE AND NUMPYDOC_FOUND AND SPHINX_GALLERY_FOUND AND MATPLOTLIB_FOUND) + find_python_module (sphinx_copybutton) + if (SPHINX_EXECUTABLE AND NUMPYDOC_FOUND AND SPHINX_GALLERY_FOUND AND SPHINX_COPYBUTTON_FOUND AND MATPLOTLIB_FOUND) find_python_module (sphinx) endif () if (NOT SPHINX_FOUND) @@ -134,7 +130,7 @@ endmacro () set ( CPACK_PACKAGE_NAME ${PACKAGE_NAME} ) set ( CPACK_PACKAGE_VERSION_MAJOR 0 ) -set ( CPACK_PACKAGE_VERSION_MINOR 17 ) +set ( CPACK_PACKAGE_VERSION_MINOR 18 ) set ( CPACK_PACKAGE_VERSION_PATCH ) set ( CPACK_SOURCE_GENERATOR "TGZ;TBZ2" ) set (CPACK_BINARY_STGZ OFF CACHE BOOL "STGZ") diff --git a/VERSION b/VERSION index 50653ad..a4d2ace 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.17 +0.18 diff --git a/distro/debian/changelog b/distro/debian/changelog index 14617a0..7368846 100644 --- a/distro/debian/changelog +++ b/distro/debian/changelog @@ -1,4 +1,4 @@ -otmixmod (0.17-0.1) unstable; urgency=low +otmixmod (0.18-0.1) unstable; urgency=low * Non-maintainer upload. * Initial release. diff --git a/distro/rpm/otmixmod.spec b/distro/rpm/otmixmod.spec index 2fd3e0e..92a8fe9 100644 --- a/distro/rpm/otmixmod.spec +++ b/distro/rpm/otmixmod.spec @@ -20,7 +20,7 @@ FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \ -DBUILD_SHARED_LIBS:BOOL=ON Name: otmixmod -Version: 0.17 +Version: 0.18 Release: 0%{?dist} Summary: OpenTURNS module Group: System Environment/Libraries diff --git a/python/doc/conf.py.in b/python/doc/conf.py.in index 382a779..48d2da9 100644 --- a/python/doc/conf.py.in +++ b/python/doc/conf.py.in @@ -67,6 +67,9 @@ imgmath_embed = True extensions.append('matplotlib.sphinxext.plot_directive') +extensions.append('sphinx_copybutton') +copybutton_prompt_text = ">>> " + extensions.append('sphinx_gallery.gen_gallery') sphinx_gallery_conf = { 'examples_dirs': ['examples'], # path to example scripts @@ -78,7 +81,7 @@ sphinx_gallery_conf = { templates_path = ['_templates'] # The suffix of source filenames. -source_suffix = '.rst' +source_suffix = {'.rst': 'restructuredtext'} # The encoding of source files. #source_encoding = 'utf-8-sig' @@ -88,7 +91,7 @@ master_doc = 'index' # General information about the project. project = u'otmixmod' -copyright = u'2005-2020 Airbus-EDF-IMACS-ONERA-Phimeca' +copyright = u'2005-2024 Airbus-EDF-IMACS-ONERA-Phimeca' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -287,3 +290,6 @@ texinfo_documents = [ # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' + +# If true, Sphinx will warn about all references where the target cannot be found. +nitpicky = True diff --git a/python/src/__init__.py b/python/src/__init__.py index c38f900..2a8d223 100644 --- a/python/src/__init__.py +++ b/python/src/__init__.py @@ -16,4 +16,4 @@ from .otmixmod import * -__version__ = '0.17' +__version__ = '0.18'