Skip to content

Commit f39221b

Browse files
Merge pull request #32 from IntelPython/py312-support
Replace nose with pytest for py312
2 parents 57887c6 + 2d7a543 commit f39221b

File tree

10 files changed

+1426
-1301
lines changed

10 files changed

+1426
-1301
lines changed

.github/workflows/build-with-clang.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ on:
55
branches: [master]
66

77
jobs:
8-
generate-coverage:
9-
name: Generate coverage and push to Coveralls.io
8+
build-with-clang:
9+
name: Build project with IntelLLVM clang compiler
1010
runs-on: ubuntu-latest
1111

1212
env:
1313
ONEAPI_ROOT: /opt/intel/oneapi
1414

1515
steps:
1616
- name: Cancel Previous Runs
17-
uses: styfle/cancel-workflow-action@0.11.0
17+
uses: styfle/cancel-workflow-action@0.12.1
1818
with:
1919
access_token: ${{ github.token }}
2020

@@ -33,13 +33,13 @@ jobs:
3333
sudo apt-get install intel-oneapi-mkl-devel
3434
3535
- name: Setup Python
36-
uses: actions/setup-python@v4
36+
uses: actions/setup-python@v5
3737
with:
38-
python-version: '3.11'
38+
python-version: '3.12'
3939
architecture: x64
4040

4141
- name: Checkout repo
42-
uses: actions/checkout@v3
42+
uses: actions/checkout@v4
4343
with:
4444
fetch-depth: 0
4545

@@ -57,10 +57,9 @@ jobs:
5757
run: |
5858
source /opt/intel/oneapi/setvars.sh
5959
echo $CMPLR_ROOT
60-
export CC=$CMPLR_ROOT/../latest/bin-llvm/clang
61-
export CXX=$CMPLR_ROOT/../latest/bin-llvm/clang++
62-
echo "CC = ${CC} CXX=${CXX}"
63-
ls -l ${CC} ${CXX}
60+
export CC=$CMPLR_ROOT/bin/icx
61+
export CXX=$CMPLR_ROOT/bin/icpx
62+
export CFLAGS="${CFLAGS} -fno-fast-math -O2"
6463
python setup.py develop
6564
6665
- name: Run mkl_random tests

.github/workflows/conda-package.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@ env:
66
PACKAGE_NAME: mkl_random
77
MODULE_NAME: mkl_random
88
VER_SCRIPT1: "import json; f = open('ver.json', 'r'); j = json.load(f); f.close(); "
9-
VER_SCRIPT2: "d = j['dpctl'][0]; print('='.join((d[s] for s in ('version', 'build'))))"
9+
VER_SCRIPT2: "d = j['mkl_random'][0]; print('='.join((d[s] for s in ('version', 'build'))))"
1010

1111
jobs:
1212
build_linux:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
python: [3.9]
16+
python: ["3.9", "3.10", "3.11", "3.12"]
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
1919
with:
2020
fetch-depth: 0
2121

2222
- name: Set pkgs_dirs
2323
run: |
2424
echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc
2525
- name: Cache conda packages
26-
uses: actions/cache@v2
26+
uses: actions/cache@v4
2727
env:
2828
CACHE_NUMBER: 0 # Increase to reset cache
2929
with:
@@ -40,7 +40,7 @@ jobs:
4040
run: conda install conda-build
4141
- name: Build conda package
4242
run: |
43-
CHANNELS="-c intel -c defaults --override-channels"
43+
CHANNELS="-c conda-forge -c intel --override-channels"
4444
VERSIONS="--python ${{ matrix.python }}"
4545
TEST="--no-test"
4646
@@ -50,7 +50,7 @@ jobs:
5050
$CHANNELS \
5151
conda-recipe
5252
- name: Upload artifact
53-
uses: actions/upload-artifact@v2
53+
uses: actions/upload-artifact@v4
5454
with:
5555
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
5656
path: /usr/share/miniconda/conda-bld/linux-64/${{ env.PACKAGE_NAME }}-*.tar.bz2
@@ -60,20 +60,20 @@ jobs:
6060

6161
strategy:
6262
matrix:
63-
python: ['3.9']
63+
python: ['3.9', '3.10', '3.11', '3.12']
6464
env:
6565
conda-bld: C:\Miniconda\conda-bld\win-64\
6666
steps:
67-
- uses: actions/checkout@v2
67+
- uses: actions/checkout@v4
6868
with:
6969
fetch-depth: 0
70-
- uses: conda-incubator/setup-miniconda@v2
70+
- uses: conda-incubator/setup-miniconda@v3
7171
with:
7272
auto-activate-base: true
7373
activate-environment: ""
7474

7575
- name: Cache conda packages
76-
uses: actions/cache@v3
76+
uses: actions/cache@v4
7777
env:
7878
CACHE_NUMBER: 3 # Increase to reset cache
7979
with:
@@ -86,9 +86,9 @@ jobs:
8686
- name: Install conda-build
8787
run: conda install conda-build
8888
- name: Build conda package
89-
run: conda build --no-test --python ${{ matrix.python }} -c intel -c defaults --override-channels conda-recipe
89+
run: conda build --no-test --python ${{ matrix.python }} -c intel -c conda-forge --override-channels conda-recipe
9090
- name: Upload artifact
91-
uses: actions/upload-artifact@v2
91+
uses: actions/upload-artifact@v4
9292
with:
9393
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
9494
path: ${{ env.conda-bld }}${{ env.PACKAGE_NAME }}-*.tar.bz2
@@ -99,16 +99,16 @@ jobs:
9999

100100
strategy:
101101
matrix:
102-
python: [3.9]
102+
python: ['3.9', '3.10', '3.11', '3.12']
103103
experimental: [false]
104104
runner: [ubuntu-latest]
105105
continue-on-error: ${{ matrix.experimental }}
106106
env:
107-
CHANNELS: -c intel -c defaults --override-channels
107+
CHANNELS: -c conda-forge -c intel --override-channels
108108

109109
steps:
110110
- name: Download artifact
111-
uses: actions/download-artifact@v2
111+
uses: actions/download-artifact@v4
112112
with:
113113
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
114114
- name: Add conda to system path
@@ -135,7 +135,7 @@ jobs:
135135
run: |
136136
echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc
137137
- name: Cache conda packages
138-
uses: actions/cache@v2
138+
uses: actions/cache@v4
139139
env:
140140
CACHE_NUMBER: 0 # Increase to reset cache
141141
with:
@@ -151,34 +151,34 @@ jobs:
151151
. $CONDA/etc/profile.d/conda.sh
152152
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
153153
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
154-
conda create -n test_mkl_random $PACKAGE_NAME=${PACKAGE_VERSION} nose python=${{ matrix.python }} $CHANNELS
154+
conda create -n test_mkl_random $PACKAGE_NAME=${PACKAGE_VERSION} pytest python=${{ matrix.python }} $CHANNELS
155155
# Test installed packages
156156
conda list
157157
- name: Run tests
158158
run: |
159159
. $CONDA/etc/profile.d/conda.sh
160160
conda activate test_mkl_random
161-
nosetests -v mkl_random
161+
pytest -vv --pyargs mkl_random
162162
163163
test_windows:
164164
needs: build_windows
165165
runs-on: ${{ matrix.runner }}
166166

167167
strategy:
168168
matrix:
169-
python: ['3.9']
169+
python: ['3.9', '3.10', '3.11', '3.12']
170170
experimental: [false]
171171
runner: [windows-latest]
172172
continue-on-error: ${{ matrix.experimental }}
173173
env:
174-
CHANNELS: -c intel -c defaults --override-channels
174+
CHANNELS: -c conda-forge -c intel --override-channels
175175

176176
steps:
177177
- name: Download artifact
178-
uses: actions/download-artifact@v2
178+
uses: actions/download-artifact@v4
179179
with:
180180
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
181-
- uses: conda-incubator/setup-miniconda@v2
181+
- uses: conda-incubator/setup-miniconda@v3
182182
with:
183183
auto-activate-base: true
184184
activate-environment: ""
@@ -205,7 +205,7 @@ jobs:
205205
conda create -n test_mkl_random ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
206206
more lockfile
207207
- name: Cache conda packages
208-
uses: actions/cache@v3
208+
uses: actions/cache@v4
209209
env:
210210
CACHE_NUMBER: 3 # Increase to reset cache
211211
with:
@@ -224,10 +224,10 @@ jobs:
224224
FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
225225
SET PACKAGE_VERSION=%%F
226226
)
227-
conda create -n test_mkl_random ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% nose python=${{ matrix.python }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }}
227+
conda create -n test_mkl_random ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% pytest python=${{ matrix.python }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }}
228228
# Test installed packages
229229
conda list
230230
- name: Run tests
231231
run: |
232232
conda activate -n test_mkl_random
233-
nosetests -v ${{ env.MODULE_NAME }}
233+
pytest -v --pyargs ${{ env.MODULE_NAME }}

conda-recipe/bld.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@rem Remember to source the compiler
22

33
set MKLROOT=%CONDA_PREFIX%
4-
%PYTHON% setup.py install --old-and-unmanageable
4+
%PYTHON% setup.py install
55
if errorlevel 1 exit 1

conda-recipe/build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash -x
22

33
export CFLAGS="-I$PREFIX/include $CFLAGS"
4-
MKLROOT=$CONDA_PREFIX $PYTHON setup.py install --old-and-unmanageable
4+
export MKLROOT=$CONDA_PREFIX
5+
$PYTHON setup.py install

conda-recipe/meta.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ build:
1313
ignore_run_exports:
1414
- blas
1515

16-
1716
requirements:
1817
build:
1918
- {{ compiler('c') }}
@@ -24,16 +23,17 @@ requirements:
2423
- mkl-devel
2524
- cython
2625
- numpy-base
26+
- pip
2727
run:
2828
- python
29-
- {{ pin_compatible('mkl', min_pin="x.x", max_pin="x.x") }}
30-
- {{ pin_compatible('numpy') }}
29+
- {{ pin_compatible('mkl', min_pin="x.x", max_pin="x") }}
30+
- {{ pin_compatible('numpy', min_pin="x.x", max_pin="x") }}
3131

3232
test:
3333
commands:
34-
- nosetests -v mkl_random
34+
- pytest --pyargs mkl_random
3535
requires:
36-
- nose
36+
- pytest
3737
- mkl-service
3838
- numpy
3939
imports:

0 commit comments

Comments
 (0)