Skip to content

Commit

Permalink
fix: Fix pre release tests (#1219)
Browse files Browse the repository at this point in the history
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.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## 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.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
Czaki authored Oct 22, 2024
1 parent f6f30e8 commit fec1eb3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
43 changes: 32 additions & 11 deletions .github/workflows/test_prereleases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions requirements/pre_test_problematic_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
mpmath!=1.4.0a0
ipykernel!=7.0.0a0

0 comments on commit fec1eb3

Please sign in to comment.