Skip to content

Bump path-to-regexp from 0.1.12 to 0.1.13 in /frontend #225

Bump path-to-regexp from 0.1.12 to 0.1.13 in /frontend

Bump path-to-regexp from 0.1.12 to 0.1.13 in /frontend #225

Workflow file for this run

name: test-uv
on:
push:
branches:
- "master"
- "main"
tags:
- "v*"
pull_request:
merge_group:
workflow_dispatch:
inputs:
git-ref:
description: "Git ref (optional)"
required: false
jobs:
test:
permissions:
contents: read
actions: read
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.12", "3.13"]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Linux system deps (Xvfb/X11)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 \
libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0
shell: bash
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Install test deps with uv
run: |
# Prefer dev requirements if present
if [ -f requirements-dev.txt ]; then
uv pip install --system -r requirements-dev.txt
else
uv pip install --system pytest
fi
# Install additional test dependencies that might be needed
uv pip install --system pytest-xvfb
shell: bash
- name: Install project with uv (editable)
run: |
echo "Installing project with UV..."
uv pip install --system -e .
echo "Checking if psygnal is installed..."
uv pip list | grep psygnal || echo "psygnal not found"
echo "Uninstalling psygnal..."
uv pip uninstall psygnal || echo "psygnal uninstall failed (not installed)"
echo "Installing pinned psygnal..."
uv pip install "psygnal==0.11.1" --system
# psygnal 0.11+ may ship compiled modules that break subclassing in ImSwitch.
# Decompile explicitly to force pure-Python modules.
python -c "import psygnal.utils; psygnal.utils.decompile()"
echo "Verifying installation..."
python -c "import dataclasses_json; print('dataclasses_json imported successfully')" || echo "dataclasses_json import failed"
python -c "import psygnal; print('psygnal imported successfully')" || echo "psygnal import failed"
shell: bash
- name: Verify installation
run: |
echo "=== UV pip list ==="
uv pip list
echo "=== Python package verification ==="
python -c "import imswitch; print(f'ImSwitch version: {imswitch.__version__}')"
echo "=== Testing critical imports ==="
python -c "from imswitch.imcontrol.model import Options; print('Options import successful')" || echo "Options import failed"
shell: bash
- name: Wait for frontend to build
id: wait-build-frontend
uses: lucasssvaz/wait-on-workflow@v1
with:
workflow: build-frontend.yaml
sha: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Download built frontend
uses: actions/download-artifact@v5
with:
name: frontend
path: ./frontend/build
github-token: ${{github.token}}
run-id: ${{ steps.wait-build-frontend.outputs.run-id }}
- name: Run Unit Tests
run: |
# Run unit tests directly from source directory
# The -p no:arkitekt_next disables the arkitekt pytest plugin which requires arkitekt_server
# Note: pytest.ini already configures this, but we add it explicitly for clarity
if [ "$RUNNER_OS" == "Linux" ]; then
xvfb-run --server-args "-screen 0 1920x1080x24" python3 -m pytest \
imswitch/imcontrol/_test/unit \
-p no:arkitekt_next \
-v --tb=short
else
python3 -m pytest \
imswitch/imcontrol/_test/unit \
-p no:arkitekt_next \
-v --tb=short
fi
shell: bash