Skip to content

Commit ee53007

Browse files
committed
pick numpy version per python version
1 parent 9a76577 commit ee53007

1 file changed

Lines changed: 30 additions & 8 deletions

File tree

.github/workflows/conda-package.yml

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,17 @@ jobs:
2222
runs-on: ubuntu-latest
2323
strategy:
2424
matrix:
25-
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
25+
include:
26+
- python: "3.10"
27+
numpy: "2.2"
28+
- python: "3.11"
29+
numpy: "2.3"
30+
- python: "3.12"
31+
numpy: "2.3"
32+
- python: "3.13"
33+
numpy: "2.3"
34+
- python: "3.14"
35+
numpy: "2.3"
2636
steps:
2737
- name: Cancel Previous Runs
2838
uses: styfle/cancel-workflow-action@d07a454dad7609a92316b57b23c9ccfd4f59af66 # 0.13.1
@@ -69,7 +79,7 @@ jobs:
6979
- name: Build conda package
7080
run: |
7181
CHANNELS=(-c "https://software.repos.intel.com/python/conda" -c "conda-forge" --override-channels)
72-
VERSIONS=(--python "${{ matrix.python }}")
82+
VERSIONS=(--python "${{ matrix.python }}" --numpy "${{ matrix.numpy }}")
7383
TEST=(--no-test)
7484
echo "CONDA_BLD=${CONDA}/conda-bld/linux-64" >> "$GITHUB_ENV"
7585
@@ -92,6 +102,7 @@ jobs:
92102
strategy:
93103
matrix:
94104
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
105+
numpy: ['numpy">=2"']
95106
experimental: [false]
96107
runner: [ubuntu-latest]
97108
continue-on-error: ${{ matrix.experimental }}
@@ -129,7 +140,7 @@ jobs:
129140
run: |
130141
CHANNELS=(-c "$GITHUB_WORKSPACE/channel" -c "https://software.repos.intel.com/python/conda" -c "conda-forge" --override-channels)
131142
PACKAGE_VERSION="$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")"
132-
conda create -n "${{ env.TEST_ENV_NAME }}" "${PACKAGE_NAME}=${PACKAGE_VERSION}" "python=${{ matrix.python }}" "${CHANNELS[@]}" --only-deps --dry-run > lockfile
143+
conda create -n "${{ env.TEST_ENV_NAME }}" "${PACKAGE_NAME}=${PACKAGE_VERSION}" "python=${{ matrix.python }}" ${{ matrix.numpy }} "${CHANNELS[@]}" --only-deps --dry-run > lockfile
133144
- name: Display lockfile
134145
run: cat lockfile
135146

@@ -153,7 +164,7 @@ jobs:
153164
run: |
154165
CHANNELS=(-c "$GITHUB_WORKSPACE/channel" -c "https://software.repos.intel.com/python/conda" -c "conda-forge" --override-channels)
155166
PACKAGE_VERSION="$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")"
156-
conda create -n "${{ env.TEST_ENV_NAME }}" "python=${{ matrix.python }}" "$PACKAGE_NAME=${PACKAGE_VERSION}" pytest "${CHANNELS[@]}"
167+
conda create -n "${{ env.TEST_ENV_NAME }}" "python=${{ matrix.python }}" ${{ matrix.numpy }} "$PACKAGE_NAME=${PACKAGE_VERSION}" pytest "${CHANNELS[@]}"
157168
# Test installed packages
158169
conda list -n "${{ env.TEST_ENV_NAME }}"
159170
@@ -174,7 +185,17 @@ jobs:
174185

175186
strategy:
176187
matrix:
177-
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
188+
include:
189+
- python: "3.10"
190+
numpy: "2.2"
191+
- python: "3.11"
192+
numpy: "2.3"
193+
- python: "3.12"
194+
numpy: "2.3"
195+
- python: "3.13"
196+
numpy: "2.3"
197+
- python: "3.14"
198+
numpy: "2.3"
178199
env:
179200
conda-bld: C:\Miniconda\conda-bld\win-64\
180201
steps:
@@ -221,7 +242,7 @@ jobs:
221242
- name: Build conda package
222243
run: |
223244
conda activate
224-
conda build --no-test --python ${{ matrix.python }} -c https://software.repos.intel.com/python/conda -c conda-forge --override-channels conda-recipe
245+
conda build --no-test --python ${{ matrix.python }} --numpy ${{ matrix.numpy }} -c https://software.repos.intel.com/python/conda -c conda-forge --override-channels conda-recipe
225246
226247
- name: Upload artifact
227248
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
@@ -238,6 +259,7 @@ jobs:
238259
strategy:
239260
matrix:
240261
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
262+
numpy: ['numpy">=2"']
241263
experimental: [false]
242264
runner: [windows-latest]
243265
continue-on-error: ${{ matrix.experimental }}
@@ -315,7 +337,7 @@ jobs:
315337
FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
316338
SET PACKAGE_VERSION=%%F
317339
)
318-
conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
340+
conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} ${{ matrix.numpy }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
319341
320342
- name: Display lockfile content
321343
shell: pwsh
@@ -349,7 +371,7 @@ jobs:
349371
SET "TEST_DEPENDENCIES=pytest pytest-cov"
350372
SET "WORKAROUND_DEPENDENCIES=intel-openmp"
351373
SET "DEPENDENCIES=%TEST_DEPENDENCIES% %WORKAROUND_DEPENDENCIES%"
352-
conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %DEPENDENCIES% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
374+
conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %DEPENDENCIES% python=${{ matrix.python }} ${{ matrix.numpy }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
353375
354376
- name: Report content of test environment
355377
shell: cmd /C CALL {0}

0 commit comments

Comments
 (0)