diff --git a/.github/workflows/conda-package-cf.yml b/.github/workflows/conda-package-cf.yml index 4deacc14..188f4ef5 100644 --- a/.github/workflows/conda-package-cf.yml +++ b/.github/workflows/conda-package-cf.yml @@ -21,24 +21,16 @@ jobs: strategy: matrix: include: - - python: "3.10" - numpy: "2.2" - python: "3.11" - numpy: "2.3" - python: "3.12" - numpy: "2.3" - python: "3.13" - numpy: "2.3" - python: "3.14" - numpy: "2.3" python_spec: "3.14.* *_cp314" python_tag: "3.14" - python: "3.14" - numpy: "2.3" python_spec: "3.14.* *_cp314t" python_tag: "3.14t" - python: "3.15" - numpy: "2.5" python_spec: "3.15.* *_cp315" python_tag: "3.15" @@ -78,7 +70,7 @@ jobs: - name: Build conda package run: | CHANNELS=(-c conda-forge --override-channels) - VERSIONS=(--python "${{ matrix.python_spec || matrix.python }}" --numpy "${{ matrix.numpy }}") + VERSIONS=(--python "${{ matrix.python_spec || matrix.python }}") TEST=(--no-test) conda build \ @@ -101,24 +93,16 @@ jobs: strategy: matrix: include: - - python: "3.10" - numpy: "2.2" - python: "3.11" - numpy: "2.3" - python: "3.12" - numpy: "2.3" - python: "3.13" - numpy: "2.3" - python: "3.14" - numpy: "2.3" python_spec: "3.14.* *_cp314" python_tag: "3.14" - python: "3.14" - numpy: "2.3" python_spec: "3.14.* *_cp314t" python_tag: "3.14t" - python: "3.15" - numpy: "2.5" python_spec: "3.15.* *_cp315" python_tag: "3.15" @@ -166,7 +150,7 @@ jobs: conda list -n base - name: Build conda package - run: conda build --no-test --python "${{ matrix.python_spec || matrix.python }}" --numpy ${{ matrix.numpy }} -c conda-forge --override-channels conda-recipe-cf + run: conda build --no-test --python "${{ matrix.python_spec || matrix.python }}" -c conda-forge --override-channels conda-recipe-cf - name: Upload artifact uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 @@ -181,24 +165,16 @@ jobs: strategy: matrix: include: - - python: "3.10" - numpy: "2.2" - python: "3.11" - numpy: "2.3" - python: "3.12" - numpy: "2.3" - python: "3.13" - numpy: "2.3" - python: "3.14" - numpy: "2.3" python_spec: "3.14.* *_cp314" python_tag: "3.14" - python: "3.14" - numpy: "2.3" python_spec: "3.14.* *_cp314t" python_tag: "3.14t" - python: "3.15" - numpy: "2.5" python_spec: "3.15.* *_cp315" python_tag: "3.15" @@ -232,7 +208,7 @@ jobs: . "$CONDA/etc/profile.d/conda.sh" PACKAGE_VERSION="$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")" export PACKAGE_VERSION - conda create -n "${{ env.TEST_ENV_NAME }}" "${PACKAGE_NAME}=${PACKAGE_VERSION}" "python=${{ matrix.python_spec || matrix.python }}" "numpy=${{ matrix.numpy }}" -c "$GITHUB_WORKSPACE/channel" -c conda-forge --override-channels --only-deps --dry-run > lockfile + conda create -n "${{ env.TEST_ENV_NAME }}" "${PACKAGE_NAME}=${PACKAGE_VERSION}" "python=${{ matrix.python_spec || matrix.python }}" -c "$GITHUB_WORKSPACE/channel" -c conda-forge --override-channels --only-deps --dry-run > lockfile cat lockfile - name: Set pkgs_dirs @@ -251,20 +227,9 @@ jobs: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python_tag || matrix.python }}- ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}- - - name: Install mkl_random - run: | - . "$CONDA/etc/profile.d/conda.sh" - PACKAGE_VERSION="$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")" - export PACKAGE_VERSION - conda create -n "${{ env.TEST_ENV_NAME }}" "${PACKAGE_NAME}=${PACKAGE_VERSION}" pytest "python=${{ matrix.python_spec || matrix.python }}" "numpy=${{ matrix.numpy }}" -c "$GITHUB_WORKSPACE/channel" -c conda-forge --override-channels - # Test installed packages - conda list - - name: Run tests run: | - . "$CONDA/etc/profile.d/conda.sh" - conda activate "${{ env.TEST_ENV_NAME }}" - pytest -vv --pyargs ${{ env.MODULE_NAME }} + conda build --test "$GITHUB_WORKSPACE"/channel/linux-64/"${PACKAGE_NAME}"-*.conda -c conda-forge --override-channels test_windows: needs: build_windows @@ -275,24 +240,16 @@ jobs: strategy: matrix: include: - - python: "3.10" - numpy: "2.2" - python: "3.11" - numpy: "2.3" - python: "3.12" - numpy: "2.3" - python: "3.13" - numpy: "2.3" - python: "3.14" - numpy: "2.3" python_spec: "3.14.* *_cp314" python_tag: "3.14" - python: "3.14" - numpy: "2.3" python_spec: "3.14.* *_cp314t" python_tag: "3.14t" - python: "3.15" - numpy: "2.5" python_spec: "3.15.* *_cp315" python_tag: "3.15" @@ -311,9 +268,9 @@ jobs: channels: conda-forge activate-environment: base - - name: Install conda-index + - name: Install conda-build run: | - conda install conda-index + conda install conda-build - name: Create conda channel run: | @@ -334,7 +291,7 @@ jobs: FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO ( SET PACKAGE_VERSION=%%F ) - conda create -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% "python=${{ matrix.python_spec || matrix.python }}" numpy=${{ matrix.numpy }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile + conda create -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% "python=${{ matrix.python_spec || matrix.python }}" -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile - name: Cache conda packages uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 @@ -348,47 +305,25 @@ jobs: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python_tag || matrix.python }}- ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}- - - name: Install mkl_random - shell: cmd - run: | - @ECHO ON - copy /Y ${{ env.GITHUB_WORKSPACE }}\ver.json . - set "SCRIPT=%VER_SCRIPT1% %VER_SCRIPT2%" - FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO ( - SET PACKAGE_VERSION=%%F - ) - conda create -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% pytest "python=${{ matrix.python_spec || matrix.python }}" numpy=${{ matrix.numpy }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }} - # Test installed packages - conda list - - name: Run tests run: | - conda activate ${{ env.TEST_ENV_NAME }} - pytest -v --pyargs ${{ env.MODULE_NAME }} + conda build --test ${{ env.GITHUB_WORKSPACE }}\channel\win-64\${{ env.PACKAGE_NAME }}-*.conda -c conda-forge --override-channels build_osx: runs-on: macos-26-intel strategy: matrix: include: - - python: "3.10" - numpy: "2.2" - python: "3.11" - numpy: "2.3" - python: "3.12" - numpy: "2.3" - python: "3.13" - numpy: "2.3" - python: "3.14" - numpy: "2.3" python_spec: "3.14.* *_cp314" python_tag: "3.14" - python: "3.14" - numpy: "2.3" python_spec: "3.14.* *_cp314t" python_tag: "3.14t" - python: "3.15" - numpy: "2.5" python_spec: "3.15.* *_cp315" python_tag: "3.15" @@ -437,7 +372,7 @@ jobs: shell: bash -el {0} run: | CHANNELS=(-c conda-forge --override-channels) - VERSIONS=(--python "${{ matrix.python_spec || matrix.python }}" --numpy "${{ matrix.numpy }}") + VERSIONS=(--python "${{ matrix.python_spec || matrix.python }}") TEST=(--no-test) conda build \ @@ -458,24 +393,16 @@ jobs: strategy: matrix: include: - - python: "3.10" - numpy: "2.2" - python: "3.11" - numpy: "2.3" - python: "3.12" - numpy: "2.3" - python: "3.13" - numpy: "2.3" - python: "3.14" - numpy: "2.3" python_spec: "3.14.* *_cp314" python_tag: "3.14" - python: "3.14" - numpy: "2.3" python_spec: "3.14.* *_cp314t" python_tag: "3.14t" - python: "3.15" - numpy: "2.5" python_spec: "3.15.* *_cp315" python_tag: "3.15" @@ -491,9 +418,9 @@ jobs: channels: conda-forge activate-environment: base - - name: Install conda-index + - name: Install conda-build shell: bash -el {0} - run: conda install -n base -y conda-index + run: conda install -n base -y conda-build - name: Create conda channel shell: bash -el {0} @@ -511,7 +438,7 @@ jobs: run: | PACKAGE_VERSION="$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")" export PACKAGE_VERSION - conda create -n "${{ env.TEST_ENV_NAME }}" "${PACKAGE_NAME}=${PACKAGE_VERSION}" "python=${{ matrix.python_spec || matrix.python }}" "numpy=${{ matrix.numpy }}" -c "$GITHUB_WORKSPACE/channel" -c conda-forge --override-channels --only-deps --dry-run > lockfile + conda create -n "${{ env.TEST_ENV_NAME }}" "${PACKAGE_NAME}=${PACKAGE_VERSION}" "python=${{ matrix.python_spec || matrix.python }}" -c "$GITHUB_WORKSPACE/channel" -c conda-forge --override-channels --only-deps --dry-run > lockfile cat lockfile - name: Cache conda packages @@ -526,17 +453,7 @@ jobs: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python_tag || matrix.python }}- ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}- - - name: Install mkl_random - shell: bash -el {0} - run: | - PACKAGE_VERSION="$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")" - export PACKAGE_VERSION - conda create -n "${{ env.TEST_ENV_NAME }}" "${PACKAGE_NAME}=${PACKAGE_VERSION}" pytest "python=${{ matrix.python_spec || matrix.python }}" "numpy=${{ matrix.numpy }}" -c "$GITHUB_WORKSPACE/channel" -c conda-forge --override-channels - # Test installed packages - conda list -n "${{ env.TEST_ENV_NAME }}" - - name: Run tests shell: bash -el {0} run: | - conda activate ${{ env.TEST_ENV_NAME }} - pytest -vv --pyargs ${{ env.MODULE_NAME }} + conda build --test "$GITHUB_WORKSPACE"/channel/osx-64/"${PACKAGE_NAME}"-*.conda -c conda-forge --override-channels diff --git a/conda-recipe-cf/bld.bat b/conda-recipe-cf/bld.bat index a08c27bb..28cc5082 100644 --- a/conda-recipe-cf/bld.bat +++ b/conda-recipe-cf/bld.bat @@ -1,2 +1,6 @@ +:: MKL is found through %LIBRARY_PREFIX%\lib\cmake\mkl, which is on +:: CMAKE_PREFIX_PATH via the vs2022 activation script. Setting MKLROOT here +:: would break the build: MKLConfig.cmake looks for %MKLROOT%\include with +:: NO_DEFAULT_PATH and %PREFIX%\include holds no MKL headers. %PYTHON% -m pip install --no-build-isolation --no-deps . if errorlevel 1 exit 1 diff --git a/conda-recipe-cf/build.sh b/conda-recipe-cf/build.sh index 72e5e4e6..65ecd921 100644 --- a/conda-recipe-cf/build.sh +++ b/conda-recipe-cf/build.sh @@ -1,3 +1,7 @@ #!/bin/bash -ex +# meson locates MKL via find_package(MKL CONFIG) -> $PREFIX/lib/cmake/mkl, +# which is on CMAKE_PREFIX_PATH thanks to the compiler activation scripts. +# Do not export MKLROOT: MKLConfig.cmake then searches $MKLROOT/include with +# NO_DEFAULT_PATH and hard-errors if mkl_version.h is not there. $PYTHON -m pip install --no-build-isolation --no-deps . diff --git a/conda-recipe-cf/conda_build_config.yaml b/conda-recipe-cf/conda_build_config.yaml index a830d0aa..dce869b5 100644 --- a/conda-recipe-cf/conda_build_config.yaml +++ b/conda-recipe-cf/conda_build_config.yaml @@ -2,21 +2,23 @@ c_compiler: # [linux] - gcc # [linux] cxx_compiler: # [linux] - gxx # [linux] -cxx_compiler_version: # [linux] - - '14' # [linux] c_stdlib: # [linux] - sysroot # [linux] c_stdlib_version: # [linux] - - '2.28' # [linux] + - '2.17' # [linux] c_compiler: # [osx] - clang # [osx] cxx_compiler: # [osx] - clangxx # [osx] c_stdlib: # [osx] - macosx_deployment_target # [osx] +c_stdlib_version: # [osx] + - '11.0' # [osx] c_stdlib: # [win] - vs # [win] cxx_compiler: # [win] - vs2022 # [win] c_compiler: # [win] - vs2022 # [win] +numpy: + - '2' diff --git a/conda-recipe-cf/meta.yaml b/conda-recipe-cf/meta.yaml index 96b019f5..6035d0a9 100644 --- a/conda-recipe-cf/meta.yaml +++ b/conda-recipe-cf/meta.yaml @@ -9,27 +9,25 @@ build: number: {{ GIT_DESCRIBE_NUMBER }} ignore_run_exports: - blas - - numpy requirements: build: - {{ compiler('c') }} - {{ compiler('cxx') }} - {{ stdlib('c') }} - host: - - meson-python >=0.16.0 - cmake - ninja + host: + - meson-python >=0.16.0 + - meson >=1.8.3 - python - mkl-devel - cython >=3.1.0 - numpy - pip - - wheel >=0.41.3 run: - python - - {{ pin_compatible('numpy', min_pin="x.x", max_pin="x") }} - - {{ pin_compatible('mkl', min_pin="x.x", max_pin="x") }} + - numpy >=1.26.4 test: commands: