From 1679466bcd3967d53cfb203f5d236f299adeec77 Mon Sep 17 00:00:00 2001 From: Lorenzo Principe <28869147+lorenzomag@users.noreply.github.com> Date: Wed, 7 Aug 2024 16:37:49 +0200 Subject: [PATCH 1/5] Update pytest.yml --- .github/workflows/pytest.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 402bbaf..48cc63d 100755 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -19,19 +19,21 @@ jobs: # Test coveralls (with numba disabled) and normal pytest test: [ 'coveralls', 'pytest', ] # Only do coveralls once; pytest on all python versions - python-version: [3.8, 3.9, "3.10"] + python-version: [3.9, "3.10", "3.11", "3.12"] exclude: - - python-version: 3.8 + - python-version: 3.10 test: coveralls - - python-version: 3.9 + - python-version: 3.11 + test: coveralls + - python-version: 3.12 test: coveralls steps: - name: Setup python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5.1.1 with: python-version: ${{ matrix.python-version }} - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.7 - name: Install requirements for tests run: | # Requirements for running the notebooks as a pytest From 97fcd2567e1028d4487c7791190e100b49dcde0d Mon Sep 17 00:00:00 2001 From: Lorenzo Principe <28869147+lorenzomag@users.noreply.github.com> Date: Wed, 7 Aug 2024 17:03:39 +0200 Subject: [PATCH 2/5] Update pytest.yml + fix test Bump action versions. Use `pip install -e .` instead of `python setup.py develop` as the latter is now deprecated. Trying to fix issue with jinja2 being deprecated. --- .github/workflows/pytest.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 48cc63d..3094b2d 100755 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -29,19 +29,23 @@ jobs: test: coveralls steps: - name: Setup python - uses: actions/setup-python@v5.1.1 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Checkout repo - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4 - name: Install requirements for tests run: | + pip install --upgrade pip + # Require setuptools for python3.12 as well + pip install setuptools # Requirements for running the notebooks as a pytest pip install cython ipython pip install nbconvert nbmake pytest-xdist pytest coverage coveralls pytest-cov pytest-notebook ipython_genutils # Several optional packages that are imported in the notebooks pip install git+https://github.com/XENON1T/laidbax - python setup.py develop + pip install -e . + pip install -U jinja2 - name: Test package if: matrix.test == 'pytest' run: From 03f61dd5c4f3bbca965e4886766ddc69f41ad856 Mon Sep 17 00:00:00 2001 From: Lorenzo Principe <28869147+lorenzomag@users.noreply.github.com> Date: Wed, 7 Aug 2024 17:07:51 +0200 Subject: [PATCH 3/5] Downgrade jinja for pytest.yml The following error arises while `Test package` executes in the workflow. The following suggestion was followed: https://github.com/d2l-ai/d2l-book/issues/46#issuecomment-1262704457 --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 3094b2d..bb381c7 100755 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -41,11 +41,11 @@ jobs: pip install setuptools # Requirements for running the notebooks as a pytest pip install cython ipython + pip install jinja2==3.0.3 pip install nbconvert nbmake pytest-xdist pytest coverage coveralls pytest-cov pytest-notebook ipython_genutils # Several optional packages that are imported in the notebooks pip install git+https://github.com/XENON1T/laidbax pip install -e . - pip install -U jinja2 - name: Test package if: matrix.test == 'pytest' run: From f5db5f7fbae54db66641dade8fece964a2764b2a Mon Sep 17 00:00:00 2001 From: Lorenzo Principe <28869147+lorenzomag@users.noreply.github.com> Date: Wed, 7 Aug 2024 17:13:29 +0200 Subject: [PATCH 4/5] Update pytest.yml Recursively checkout submodules --- .github/workflows/pytest.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index bb381c7..709af4e 100755 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -34,6 +34,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Checkout repo uses: actions/checkout@v4 + with: + submodules: 'recursive' - name: Install requirements for tests run: | pip install --upgrade pip From 8866e901156457031a84b4cf817753edf475375c Mon Sep 17 00:00:00 2001 From: Lorenzo Principe <28869147+lorenzomag@users.noreply.github.com> Date: Wed, 7 Aug 2024 18:55:40 +0200 Subject: [PATCH 5/5] Update pytest.yml Add libraries for notebooks --- .github/workflows/pytest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 709af4e..ecb4de8 100755 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -48,6 +48,7 @@ jobs: # Several optional packages that are imported in the notebooks pip install git+https://github.com/XENON1T/laidbax pip install -e . + pip install seaborn matplotlib - name: Test package if: matrix.test == 'pytest' run: