Skip to content

Fix test for python 3.13 #11

Fix test for python 3.13

Fix test for python 3.13 #11

Workflow file for this run

name: CI
on:
push:
branches: [ main, master]
pull_request:
branches: [ main, master]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up conda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge,defaults
channel-priority: strict
- name: Install system dependencies
run: |
# Install system packages for Qt6 and OpenGL
sudo apt-get update
sudo apt-get install -y \
qt6-base-dev \
libqt6gui6 \
libqt6widgets6 \
libqt6opengl6-dev \
xvfb \
libegl1-mesa-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
freeglut3-dev \
libxkbcommon-x11-0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-shape0 \
libxcb-xfixes0 \
libxcb-xinerama0
- name: Install graph-tool via conda
shell: bash -l {0}
run: |
conda install -c conda-forge graph-tool
- name: Verify graph-tool installation
shell: bash -l {0}
run: |
python -c "import graph_tool.all as gt; print('✅ graph-tool imported successfully')"
- name: Cache pip packages
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'setup.py') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
- name: Install Python dependencies
shell: bash -l {0}
run: |
python -m pip install --upgrade pip setuptools wheel
pip install --upgrade --upgrade-strategy eager .[dev]
- name: Set up virtual display
run: |
export DISPLAY=:99
Xvfb :99 -screen 0 800x600x24 > /dev/null 2>&1 &
echo "DISPLAY=:99" >> $GITHUB_ENV
echo "QT_QPA_PLATFORM=offscreen" >> $GITHUB_ENV
echo "QT_QPA_FONTDIR=/usr/share/fonts" >> $GITHUB_ENV
echo "MESA_GL_VERSION_OVERRIDE=3.3" >> $GITHUB_ENV
echo "MESA_GLSL_VERSION_OVERRIDE=330" >> $GITHUB_ENV
# - name: Run linting
# shell: bash -l {0}
# run: |
# flake8 --doctests --exclude=doc
- name: Run tests with coverage
shell: bash -l {0}
run: |
export MPLBACKEND=agg
coverage run --branch --source pygsp -m pytest
coverage report
coverage xml
- name: Upload coverage to Coveralls
if: matrix.python-version == '3.11' # Only upload once
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: coverage.xml
docs:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Set up conda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: "3.11"
channels: conda-forge,defaults
channel-priority: strict
- name: Install graph-tool via conda
shell: bash -l {0}
run: |
conda install -c conda-forge graph-tool
- name: Verify graph-tool installation
shell: bash -l {0}
run: |
python -c "import graph_tool.all as gt; print('✅ graph-tool imported successfully')"
- name: Install Python dependencies
shell: bash -l {0}
run: |
python -m pip install --upgrade pip setuptools wheel
pip install --upgrade --upgrade-strategy eager .[dev,doc]
- name: Build documentation
shell: bash -l {0}
run: |
export MPLBACKEND=agg
sphinx-build -b html -d doc/_build/doctrees doc doc/_build/html
sphinx-build -b linkcheck -d doc/_build/doctrees doc doc/_build/linkcheck
- name: Upload documentation artifacts
uses: actions/upload-artifact@v3
with:
name: documentation
path: doc/_build/html/