Skip to content

Replace nose with pytest for py312 #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions .github/workflows/build-with-clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ on:
branches: [master]

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

env:
ONEAPI_ROOT: /opt/intel/oneapi

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}

Expand All @@ -33,13 +33,13 @@ jobs:
sudo apt-get install intel-oneapi-mkl-devel

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: x64

- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -57,10 +57,9 @@ jobs:
run: |
source /opt/intel/oneapi/setvars.sh
echo $CMPLR_ROOT
export CC=$CMPLR_ROOT/../latest/bin-llvm/clang
export CXX=$CMPLR_ROOT/../latest/bin-llvm/clang++
echo "CC = ${CC} CXX=${CXX}"
ls -l ${CC} ${CXX}
export CC=$CMPLR_ROOT/bin/icx
export CXX=$CMPLR_ROOT/bin/icpx
export CFLAGS="${CFLAGS} -fno-fast-math -O2"
python setup.py develop

- name: Run mkl_random tests
Expand Down
50 changes: 25 additions & 25 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ env:
PACKAGE_NAME: mkl_random
MODULE_NAME: mkl_random
VER_SCRIPT1: "import json; f = open('ver.json', 'r'); j = json.load(f); f.close(); "
VER_SCRIPT2: "d = j['dpctl'][0]; print('='.join((d[s] for s in ('version', 'build'))))"
VER_SCRIPT2: "d = j['mkl_random'][0]; print('='.join((d[s] for s in ('version', 'build'))))"

jobs:
build_linux:
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.9]
python: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set pkgs_dirs
run: |
echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc
- name: Cache conda packages
uses: actions/cache@v2
uses: actions/cache@v4
env:
CACHE_NUMBER: 0 # Increase to reset cache
with:
Expand All @@ -40,7 +40,7 @@ jobs:
run: conda install conda-build
- name: Build conda package
run: |
CHANNELS="-c intel -c defaults --override-channels"
CHANNELS="-c conda-forge -c intel --override-channels"
VERSIONS="--python ${{ matrix.python }}"
TEST="--no-test"

Expand All @@ -50,7 +50,7 @@ jobs:
$CHANNELS \
conda-recipe
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
path: /usr/share/miniconda/conda-bld/linux-64/${{ env.PACKAGE_NAME }}-*.tar.bz2
Expand All @@ -60,20 +60,20 @@ jobs:

strategy:
matrix:
python: ['3.9']
python: ['3.9', '3.10', '3.11', '3.12']
env:
conda-bld: C:\Miniconda\conda-bld\win-64\
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: conda-incubator/setup-miniconda@v2
- uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: true
activate-environment: ""

- name: Cache conda packages
uses: actions/cache@v3
uses: actions/cache@v4
env:
CACHE_NUMBER: 3 # Increase to reset cache
with:
Expand All @@ -86,9 +86,9 @@ jobs:
- name: Install conda-build
run: conda install conda-build
- name: Build conda package
run: conda build --no-test --python ${{ matrix.python }} -c intel -c defaults --override-channels conda-recipe
run: conda build --no-test --python ${{ matrix.python }} -c intel -c conda-forge --override-channels conda-recipe
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
path: ${{ env.conda-bld }}${{ env.PACKAGE_NAME }}-*.tar.bz2
Expand All @@ -99,16 +99,16 @@ jobs:

strategy:
matrix:
python: [3.9]
python: ['3.9', '3.10', '3.11', '3.12']
experimental: [false]
runner: [ubuntu-latest]
continue-on-error: ${{ matrix.experimental }}
env:
CHANNELS: -c intel -c defaults --override-channels
CHANNELS: -c conda-forge -c intel --override-channels

steps:
- name: Download artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
- name: Add conda to system path
Expand All @@ -135,7 +135,7 @@ jobs:
run: |
echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc
- name: Cache conda packages
uses: actions/cache@v2
uses: actions/cache@v4
env:
CACHE_NUMBER: 0 # Increase to reset cache
with:
Expand All @@ -151,34 +151,34 @@ jobs:
. $CONDA/etc/profile.d/conda.sh
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
conda create -n test_mkl_random $PACKAGE_NAME=${PACKAGE_VERSION} nose python=${{ matrix.python }} $CHANNELS
conda create -n test_mkl_random $PACKAGE_NAME=${PACKAGE_VERSION} pytest python=${{ matrix.python }} $CHANNELS
# Test installed packages
conda list
- name: Run tests
run: |
. $CONDA/etc/profile.d/conda.sh
conda activate test_mkl_random
nosetests -v mkl_random
pytest -vv --pyargs mkl_random

test_windows:
needs: build_windows
runs-on: ${{ matrix.runner }}

strategy:
matrix:
python: ['3.9']
python: ['3.9', '3.10', '3.11', '3.12']
experimental: [false]
runner: [windows-latest]
continue-on-error: ${{ matrix.experimental }}
env:
CHANNELS: -c intel -c defaults --override-channels
CHANNELS: -c conda-forge -c intel --override-channels

steps:
- name: Download artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
- uses: conda-incubator/setup-miniconda@v2
- uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: true
activate-environment: ""
Expand All @@ -205,7 +205,7 @@ jobs:
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
more lockfile
- name: Cache conda packages
uses: actions/cache@v3
uses: actions/cache@v4
env:
CACHE_NUMBER: 3 # Increase to reset cache
with:
Expand All @@ -224,10 +224,10 @@ jobs:
FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
SET PACKAGE_VERSION=%%F
)
conda create -n test_mkl_random ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% nose python=${{ matrix.python }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }}
conda create -n test_mkl_random ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% pytest python=${{ matrix.python }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }}
# Test installed packages
conda list
- name: Run tests
run: |
conda activate -n test_mkl_random
nosetests -v ${{ env.MODULE_NAME }}
pytest -v --pyargs ${{ env.MODULE_NAME }}
2 changes: 1 addition & 1 deletion conda-recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@rem Remember to source the compiler

set MKLROOT=%CONDA_PREFIX%
%PYTHON% setup.py install --old-and-unmanageable
%PYTHON% setup.py install
if errorlevel 1 exit 1
3 changes: 2 additions & 1 deletion conda-recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash -x

export CFLAGS="-I$PREFIX/include $CFLAGS"
MKLROOT=$CONDA_PREFIX $PYTHON setup.py install --old-and-unmanageable
export MKLROOT=$CONDA_PREFIX
$PYTHON setup.py install
10 changes: 5 additions & 5 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ build:
ignore_run_exports:
- blas


requirements:
build:
- {{ compiler('c') }}
Expand All @@ -24,16 +23,17 @@ requirements:
- mkl-devel
- cython
- numpy-base
- pip
run:
- python
- {{ pin_compatible('mkl', min_pin="x.x", max_pin="x.x") }}
- {{ pin_compatible('numpy') }}
- {{ pin_compatible('mkl', min_pin="x.x", max_pin="x") }}
- {{ pin_compatible('numpy', min_pin="x.x", max_pin="x") }}

test:
commands:
- nosetests -v mkl_random
- pytest --pyargs mkl_random
requires:
- nose
- pytest
- mkl-service
- numpy
imports:
Expand Down
Loading