Skip to content

Commit

Permalink
fix python matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
mcg1969 committed Mar 7, 2024
1 parent da64c3b commit a17041f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4
with:
name: package-${{ github.sha }}
path: conda-bld/*/*.tar.bz2
path: conda-bld
tests:
runs-on: ${{ matrix.os }}
needs: [build,testbed]
Expand Down Expand Up @@ -104,10 +104,16 @@ jobs:
run: |
source $CONDA_ROOT/etc/profile.d/conda.sh
[ "$RUNNER_OS" = "Windows" ] && export PYTHONIOENCODING=UTF-8
find $PWD/conda-bld
export PYTHONUNBUFFERED=1
conda build --test conda-bld/noarch/*.tar.bz2 | tee build.log
export NBVER=6
[ 3.12 = ${{ matrix.pyver }} ] && export NBVER=7
conda create -n testbase -c file://$PWD/conda-bld python=${{ matrix.pyver }} notebook=$NBVER local::nb_conda_kernels pytest pytest-cov mock requests
conda activate testbase
python -m nb_conda_kernels list
python -m pytest -v --cov=nb_conda_kernels tests 2>&1 | tee build.log
# Because Windows refuses to preserve the error code
if grep ' FAILED ' build.log; then exit -1; fi
if grep -E '^(FAILED|ERROR) ' build.log; then exit -1; fi
upload:
needs: tests
runs-on: ubuntu-latest
Expand Down
6 changes: 5 additions & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
from subprocess import check_output, CalledProcessError
from notebook.services.kernelspecs.tests import test_kernelspecs_api

try:
from jupyter_server.services.kernelspecs.tests import test_kernelspecs_api
except ImportError:
from notebook.services.kernelspecs.tests import test_kernelspecs_api

try:
from unittest.mock import patch
Expand Down

0 comments on commit a17041f

Please sign in to comment.