From fec1eb381de690d113296b13393bc56f9408f3b2 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Tue, 22 Oct 2024 17:10:34 +0200 Subject: [PATCH] fix: Fix pre release tests (#1219) closes #1211 closes #1217 ## Summary by Sourcery Fix the pre-release test workflow by adding a new test job and updating existing jobs to ensure tests run with the correct package constraints and environments. Bug Fixes: - Fix pre-release test workflow to correctly run tests with specific package constraints and environments. CI: - Update CI workflow to include a new test job using tox base with specific environment variables and package constraints. - Modify existing test job to specify test directories for more targeted testing. ## Summary by CodeRabbit - **New Features** - Enhanced testing capabilities with the addition of a new test step using `tox` for pre-release dependencies. - Updated dependency management commands for improved efficiency. - **Bug Fixes** - Excluded the problematic version of the `ipykernel` package to prevent installation issues. --- .github/workflows/test_prereleases.yml | 43 ++++++++++++++----- requirements/pre_test_problematic_version.txt | 1 + 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test_prereleases.yml b/.github/workflows/test_prereleases.yml index dd44f0978..8abcc9f1b 100644 --- a/.github/workflows/test_prereleases.yml +++ b/.github/workflows/test_prereleases.yml @@ -18,6 +18,10 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +concurrency: + group: pre-test-${{ github.ref }} + cancel-in-progress: true + jobs: download_data: name: Download test data @@ -74,12 +78,26 @@ jobs: pip install --upgrade pip pip install setuptools tox tox-gh-actions>=2.12.0 + - name: Test with tox base + # run tests using pip install --pre + uses: aganders3/headless-gui@v2 + timeout-minutes: 60 + with: + run: python -m tox run -v -- -v package/tests/test_PartSegImage package/tests/test_PartSegCore + env: + PLATFORM: ${{ matrix.platform }} + PYVISTA_OFF_SCREEN: True # required for opengl on windows + NAPARI: latest + BACKEND: PyQt6 + PIP_CONSTRAINT: requirements/pre_test_problematic_version.txt + PIP_PRE: 1 + - name: Test with tox linux # run tests using pip install --pre uses: aganders3/headless-gui@v2 timeout-minutes: 60 with: - run: python -m tox run -v -- -v + run: python -m tox run -v -- -v package/tests/test_PartSeg env: PLATFORM: ${{ matrix.platform }} PYVISTA_OFF_SCREEN: True # required for opengl on windows @@ -108,26 +126,29 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 - name: Install Python 3.12 + name: Install Python with: - python-version: 3.12 + python-version: 3.x - uses: tlambert03/setup-qt-libs@v1 - - name: Install dependencies + - name: Install uv + run: pip install uv + - name: Compile PyInstaller requirements run: | - pip install --upgrade pip - pip install pip-tools - - name: Compile and install PyInstaller requirements + uv pip compile --prerelease allow --python-version 3.12 --upgrade -o requirements.txt pyproject.toml requirements/pre_test_problematic_version.txt --extra pyinstaller + - name: Install dependencies run: | - pip-compile --upgrade -o requirements.txt pyproject.toml requirements/pre_test_problematic_version.txt --extra pyinstaller --pre - pip-sync - pip install . + uv venv --python 3.12 + uv pip install -r requirements.txt + uv pip install . - name: upload requirements uses: actions/upload-artifact@v4 with: name: requirements path: requirements.txt - name: Run PyInstaller - run: python build_utils/create_and_pack_executable.py + run: | + source .venv/bin/activate + python build_utils/create_and_pack_executable.py - name: Upload bundle uses: actions/upload-artifact@v4 with: diff --git a/requirements/pre_test_problematic_version.txt b/requirements/pre_test_problematic_version.txt index c33ee87e0..d4729466b 100644 --- a/requirements/pre_test_problematic_version.txt +++ b/requirements/pre_test_problematic_version.txt @@ -1 +1,2 @@ mpmath!=1.4.0a0 +ipykernel!=7.0.0a0