diff --git a/.github/workflows/debug-linux.yml b/.github/workflows/debug-linux.yml index 62268a50c..a93ff5489 100644 --- a/.github/workflows/debug-linux.yml +++ b/.github/workflows/debug-linux.yml @@ -18,7 +18,7 @@ jobs: - name: Install Zfpy Dependencies run: | python -m pip install cython - python -m pip install oldest-supported-numpy + python -m pip install "numpy>=2.0" python -m pip install setuptools - name: Install OpenMP diff --git a/.github/workflows/debug-macos.yml b/.github/workflows/debug-macos.yml index 36fbb976f..cd7bab22c 100644 --- a/.github/workflows/debug-macos.yml +++ b/.github/workflows/debug-macos.yml @@ -18,7 +18,7 @@ jobs: - name: Install Zfpy Dependencies run: | python -m pip install cython - python -m pip install oldest-supported-numpy + python -m pip install "numpy>=2.0" python -m pip install setuptools - name: Install OpenMP diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fce4abb37..382960de3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,14 @@ name: Tests -on: [push, pull_request] +on: + push: + # branches: + # - develop + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true env: BUILD_TYPE: Release @@ -48,7 +56,7 @@ jobs: - name: Install zfpy dependencies run: | python -m pip install cython - python -m pip install oldest-supported-numpy + python -m pip install "numpy>=2.0" python -m pip install setuptools - name: Setup OpenMP (Linux) diff --git a/appveyor.sh b/appveyor.sh index 94ec4e330..06f33e05c 100644 --- a/appveyor.sh +++ b/appveyor.sh @@ -31,8 +31,8 @@ if [ $COMPILER == "msvc" ] && [ $BUILD_TYPE == "Release" ]; then if [ $ACTIVE_PY_VERSION != $PYTHON_VERSION ]; then exit 1 fi - - BUILD_FLAGS="$BUILD_FLAGS -DBUILD_ZFPY=ON" + PYTHON_DIR=$(python -c 'import sys; print(sys.prefix)') + BUILD_FLAGS="$BUILD_FLAGS -DBUILD_ZFPY=ON -DPYTHON_INCLUDE_DIR=$PYTHON_DIR\\include" fi BUILD_FLAGS="$BUILD_FLAGS -DBUILD_OPENMP=OFF" @@ -46,9 +46,9 @@ cd tmpBuild # (CMAKE_SH satisfies mingw builds) set +e if [ $COMPILER != "msvc" ]; then - cmake -G "$GENERATOR" "$APPVEYOR_BUILD_FOLDER/tests/ci-utils" -DCMAKE_SH=CMAKE_SH-NOTFOUND + cmake -G "$GENERATOR" -A "$PLATFORM" "$APPVEYOR_BUILD_FOLDER/tests/ci-utils" -DCMAKE_SH=CMAKE_SH-NOTFOUND else - cmake -G "$GENERATOR" "$APPVEYOR_BUILD_FOLDER/tests/ci-utils" + cmake -G "$GENERATOR" -A "$PLATFORM" "$APPVEYOR_BUILD_FOLDER/tests/ci-utils" fi if [ $? -eq 0 ]; then diff --git a/appveyor.yml b/appveyor.yml index 8a1e4688b..3677d82c3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,44 +4,50 @@ environment: # zfpy only build for Release builds (otherwise need debug python libs python27_d.lib) matrix: - COMPILER: msvc - GENERATOR: Visual Studio 15 2017 Win64 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + GENERATOR: Visual Studio 17 2022 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 PLATFORM: x64 BUILD_TYPE: Release - PYTHON_VERSION: 38 + PYTHON_VERSION: 39 - COMPILER: msvc - GENERATOR: Visual Studio 15 2017 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + GENERATOR: Visual Studio 17 2022 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 PLATFORM: Win32 BUILD_TYPE: Release - PYTHON_VERSION: 38 + PYTHON_VERSION: 39 - COMPILER: msvc - GENERATOR: Visual Studio 14 2015 Win64 + GENERATOR: Visual Studio 16 2019 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 PLATFORM: x64 BUILD_TYPE: Release - PYTHON_VERSION: 38 + PYTHON_VERSION: 39 - COMPILER: msvc - GENERATOR: Visual Studio 14 2015 + GENERATOR: Visual Studio 16 2019 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 PLATFORM: Win32 BUILD_TYPE: Release - PYTHON_VERSION: 38 + PYTHON_VERSION: 39 - COMPILER: mingw GENERATOR: MinGW Makefiles + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 PLATFORM: Win32 BUILD_TYPE: Release + PYTHON_VERSION: 39 - COMPILER: mingw-w64 GENERATOR: MinGW Makefiles + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 PLATFORM: x64 BUILD_TYPE: Release + PYTHON_VERSION: 39 install: - - if "%COMPILER%"=="mingw" set PATH=C:\MinGW\bin;%PATH% - - if "%COMPILER%"=="mingw-w64" set PATH=C:\MinGW\bin;%PATH% + - if "%COMPILER%"=="mingw" set "PATH=C:\MinGW\bin;%PATH%" + - if "%COMPILER%"=="mingw-w64" set "PATH=C:\MinGW\bin;%PATH%" # set env vars for Python system dir (assumed to always be MSVC) - ps: | @@ -50,21 +56,20 @@ install: if ($env:PLATFORM -eq "x64") { $env:PYTHON_DIR = "$env:PYTHON_DIR-x64" } - - $env:PYTHON_LIB_PATH = "$env:PYTHON_DIR\libs\python$env:PYTHON_VERSION.lib" } + - if not "%PYTHON_DIR%" == "" if not exist "%PYTHON_DIR%" exit 1 # placing these behind a conditional for some reason prevents CMake from picking up the virtualenv - - if "%COMPILER%"=="msvc" if "%BUILD_TYPE%"=="Release" set PATH=%PYTHON_DIR%;%PYTHON_DIR%\Scripts;%PATH% - - if "%COMPILER%"=="msvc" if "%BUILD_TYPE%"=="Release" pip install virtualenv + - if "%COMPILER%"=="msvc" if "%BUILD_TYPE%"=="Release" set "PATH=%PYTHON_DIR%;%PYTHON_DIR%\Scripts;%PATH%" + - if "%COMPILER%"=="msvc" if "%BUILD_TYPE%"=="Release" pip3 install virtualenv - if "%COMPILER%"=="msvc" if "%BUILD_TYPE%"=="Release" set VIRTUALENV_NAME=pyVirtualEnv - if "%COMPILER%"=="msvc" if "%BUILD_TYPE%"=="Release" virtualenv %VIRTUALENV_NAME% - if "%COMPILER%"=="msvc" if "%BUILD_TYPE%"=="Release" "%VIRTUALENV_NAME%\\Scripts\\activate.bat" - - if "%COMPILER%"=="msvc" if "%BUILD_TYPE%"=="Release" pip install -r python\requirements.txt + - if "%COMPILER%"=="msvc" if "%BUILD_TYPE%"=="Release" pip3 install -r python\requirements.txt - if "%COMPILER%"=="msvc" if "%BUILD_TYPE%"=="Release" python --version build_script: - sh appveyor.sh # uncomment to enable interactive remote desktop mode - #- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) + # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) diff --git a/cmake/appveyor.cmake b/cmake/appveyor.cmake index 29cc79069..ee714a725 100644 --- a/cmake/appveyor.cmake +++ b/cmake/appveyor.cmake @@ -53,8 +53,8 @@ if(BUILD_ZFPY) set(CTEST_SITE "${CTEST_SITE}_zfpy$ENV{PYTHON_VERSION}") # sanitize python include dir path (ex. windows vs linux slashes) - set(PYTHON_INCLUDE_DIR "") - file(TO_CMAKE_PATH "${CTEST_SOURCE_DIRECTORY}\\$ENV{VIRTUALENV_NAME}\\Include" PYTHON_INCLUDE_DIR) + # set(PYTHON_INCLUDE_DIR "") + # file(TO_CMAKE_PATH "${CTEST_SOURCE_DIRECTORY}\\$ENV{VIRTUALENV_NAME}\\Include" PYTHON_INCLUDE_DIR) list(APPEND cfg_options -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR} diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 9410ddd7f..edc84fba9 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -11,7 +11,7 @@ find_package(PythonInterp REQUIRED) find_package(PythonLibs REQUIRED) find_package(PythonExtensions REQUIRED) find_package(Cython 0.28 REQUIRED) # >= v0.28 required for const memoryview support -find_package(NumPy REQUIRED) +find_package(NumPy 2.0 REQUIRED) include_directories(${ZFP_SOURCE_DIR}/include) include_directories(${NumPy_INCLUDE_DIR}) diff --git a/python/requirements.txt b/python/requirements.txt index 849962b23..3a6f251c9 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -1,2 +1,2 @@ cython>=0.22 -numpy>=1.8.0 +numpy>=2.0 diff --git a/setup.py b/setup.py index fa2da6efc..1651ed6ff 100644 --- a/setup.py +++ b/setup.py @@ -8,6 +8,7 @@ author_email="zfp@llnl.gov", url="https://zfp.llnl.gov", description="zfp compression in Python", + python_requires=">=3.9", long_description="zfp is a compressed format for representing multidimensional floating-point and integer arrays. zfp provides compressed-array classes that support high throughput read and write random access to individual array elements. zfp also supports serial and parallel compression of whole arrays using both lossless and lossy compression with error tolerances. zfp is primarily written in C and C++ but also includes Python and Fortran bindings.", ext_modules=[Extension("zfpy", ["build/python/zfpy.c"], include_dirs=["include", np.get_include()],