From d68c16017bfddf9297dfb56687e6c40aa018eced Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Wed, 29 May 2024 19:08:49 +0530 Subject: [PATCH] FIX: Disable `pytest` caching The pytest test suite is trying to generate additional files and it tries to save them to a filesystem that is for some reason read-only. Since this workflow runs only in a temporary CI job, the `.pyc` file generation can be disabled. Some other fixes are included as well: 1. pydantic<2 not needed anymore 2. Skip the job on forks 3. More readable condition for Anaconda upload step --- .github/workflows/emscripten.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/emscripten.yml b/.github/workflows/emscripten.yml index 64690457..3281c99b 100644 --- a/.github/workflows/emscripten.yml +++ b/.github/workflows/emscripten.yml @@ -30,8 +30,8 @@ jobs: build_wasm_emscripten: name: Build PyWavelets for Pyodide runs-on: ubuntu-latest - # Uncomment the following line to test changes on a fork - # if: github.repository == 'PyWavelets/pywt' + # Comment out the following line to test changes on a fork + if: github.repository == 'PyWavelets/pywt' steps: - name: Check out repository uses: actions/checkout@v4 @@ -44,7 +44,7 @@ jobs: - name: Install prerequisites run: | - python -m pip install pyodide-build "pydantic<2" + python -m pip install pyodide-build echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV - name: Set up Emscripten toolchain @@ -70,12 +70,16 @@ jobs: pushd demo pip install matplotlib pytest python -c "import pywt; print(pywt.__version__)" - pytest --pyargs pywt -m "not slow" + pytest -p no:cacheprovider --pyargs pywt -m "not slow" # https://anaconda.org/scientific-python-nightly-wheels/pywavelets # WARNING: this job will overwrite existing wheels. - name: Push to Anaconda PyPI index - if: (github.repository == 'PyWavelets/pywt') && (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch' && github.event.inputs.push_wheels == 'true') || (github.event_name == 'schedule') + if: >- + (github.repository == 'PyWavelets/pywt') && + (github.event_name == 'push' && github.ref == 'refs/heads/main') || + (github.event_name == 'workflow_dispatch' && github.event.inputs.push_wheels == 'true') || + (github.event_name == 'schedule') uses: scientific-python/upload-nightly-action@b67d7fcc0396e1128a474d1ab2b48aa94680f9fc # v0.5.0 with: artifacts_path: dist/