Skip to content

Commit

Permalink
Merge pull request #109 from OKaluza/master
Browse files Browse the repository at this point in the history
Wheel build overhaul and removal of ffmpeg dependency
  • Loading branch information
OKaluza authored Feb 4, 2025
2 parents e273012 + c5df03c commit 8e0f40c
Show file tree
Hide file tree
Showing 21 changed files with 404 additions and 361 deletions.
116 changes: 0 additions & 116 deletions .github/workflows/osmesa_deploy.yaml

This file was deleted.

86 changes: 86 additions & 0 deletions .github/workflows/test_deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Wheel-build-test

on:
workflow_dispatch:
#push:

jobs:
build_wheels:
name: Build test wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
CIBW_BUILD_VERBOSITY: 1 #3
CIBW_SKIP: cp*-win32 *-musllinux_* *-manylinux_i686
CIBW_BUILD: cp312-*
#CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*
CIBW_ENVIRONMENT: >
LV_LIB_DIRS=/usr/local/lib64:/usr/lib64:${HOME}/lib
LV_INC_DIRS=${HOME}/include
LV_MIN_DEPS=1
LV_ECHO_FAIL=1
LV_ARGS="-v"
CIBW_BEFORE_BUILD_LINUX: >
rpm --import https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux &&
dnf install -y libtiff-devel mesa-libOSMesa-devel && echo {package}
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_TEST_COMMAND_MACOS: >
python -m pip install moderngl &&
export LV_CONTEXT=moderngl &&
git clone --depth 1 https://github.com/lavavu/Testing &&
cd Testing &&
python runall.py
#CIBW_TEST_COMMAND_LINUX: >
# export LV_CONTEXT=osmesa &&
# git clone --depth 1 https://github.com/lavavu/Testing &&
# cd Testing &&
# python runall.py

strategy:
matrix:
# MacOS 13 runner is x86_64, 14 is arm64
# (https://cibuildwheel.pypa.io/en/stable/faq/#how)
os: [ubuntu-latest, windows-latest, macos-13, macos-14]

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.22.0

- name: Build wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.12'

- name: Install build
run: python -m pip install setuptools build

- name: Build sdist
run: python -m build . --sdist

- uses: actions/upload-artifact@v4
with:
name: sdist-${{ strategy.job-index }}
path: dist/*.tar.gz


18 changes: 10 additions & 8 deletions .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
strategy:
matrix:
#os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest] #, macos-latest] #Re-enable this at some point after duplicating the problem on 3.9+ (seems to attempt to install itself as a dependency and fails)
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
Expand All @@ -24,22 +24,24 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Set up *nix dependencies
- name: Set up linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libosmesa6 libosmesa6-dev libglapi-mesa mesa-common-dev libglx-mesa0 libgl1-mesa-dri libgl-dev libglx-dev libgl1 libglx0 libglvnd0
- name: Install prereqs
run: python -m pip install -r requirements.txt
- name: Build/install
run: LV_OSMESA=1 python -m pip install .
- name: Run headless test (linux only)
if: runner.os == 'Linux'
run: python -m pip install .
- name: Run headless test
env:
LV_CONTEXT: moderngl
LV_ECHO_FAIL: 1
LV_ARGS: -v
run: |
python -m pip install moderngl
git clone --depth 1 https://github.com/lavavu/Testing
cd Testing
export LV_ECHO_FAIL=1
export LV_ARGS="-v"
python runall.py
cd ..
72 changes: 44 additions & 28 deletions .github/workflows/wheel_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,47 @@ jobs:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
CIBW_BUILD_VERBOSITY: 3
CIBW_BUILD_VERBOSITY: 1 #3
CIBW_SKIP: cp*-win32 *-musllinux_* *-manylinux_i686
CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-*
#CIBW_TEST_COMMAND: python3 -m doctest -v lavavu/lavavu.py
CIBW_REPAIR_WHEEL_COMMAND_MACOS: delocate-listdeps {wheel} && delocate-wheel -v -w {dest_dir} {wheel}
CIBW_ENVIRONMENT: LV_LIB_DIRS=${HOME}/lib LV_INC_DIRS=${HOME}/include
CIBW_BEFORE_BUILD_LINUX: cd ~ && curl -O -L https://github.com/lavavu/LavaVu/releases/latest/download/ffmpeg-mini.zip && unzip -o ffmpeg-mini.zip && dnf install -y --nogpgcheck libtiff-devel
CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*
CIBW_ENVIRONMENT: >
LV_LIB_DIRS=/usr/local/lib64:/usr/lib64:${HOME}/lib
LV_INC_DIRS=${HOME}/include
LV_MIN_DEPS=1
LV_ECHO_FAIL=1
LV_ARGS="-v"
CIBW_BEFORE_BUILD_LINUX: >
rpm --import https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux &&
dnf install -y libtiff-devel mesa-libOSMesa-devel && echo {package}
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_TEST_COMMAND_MACOS: >
python -m pip install moderngl &&
export LV_CONTEXT=moderngl &&
git clone --depth 1 https://github.com/lavavu/Testing &&
cd Testing &&
python runall.py
#CIBW_TEST_COMMAND_LINUX: >
# export LV_CONTEXT=osmesa &&
# git clone --depth 1 https://github.com/lavavu/Testing &&
# cd Testing &&
# python runall.py

strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
# MacOS 13 runner is x86_64, 14 is arm64
# (https://cibuildwheel.pypa.io/en/stable/faq/#how)
os: [ubuntu-latest, windows-latest, macos-13, macos-14]

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.12'

- name: Setup ffmpeg (macOS only)
if: runner.os == 'macOS'
run: brew install ffmpeg@4

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.21.2
run: python -m pip install cibuildwheel==2.22.0

- name: Build wheels
run: |
Expand All @@ -58,10 +72,13 @@ jobs:
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.8'
python-version: '3.12'

- name: Install build
run: python -m pip install setuptools build

- name: Build sdist
run: python setup.py sdist
run: python -m build . --sdist

- uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -100,8 +117,8 @@ jobs:
strategy:
matrix:
#os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-13, macos-14]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
runs-on: ${{ matrix.os }}
steps:
- name: Set up Python
Expand All @@ -116,14 +133,13 @@ jobs:
run: python -c "import sys; print(sys.version)"
- name: Install wheel
run: python -m pip install --only-binary=lavavu lavavu
#- name: Run headless test (linux only)
#env:
# LV_ECHO_FAIL: "1"
# LV_ARGS: "-v"
#This needs to run with xvfb
#uses: GabrielBB/xvfb-action@v1
#if: runner.os == 'Linux'
#with:
# working-directory: ./Testing
# run: python runall.py
- name: Run tests
run: >
pip install moderngl &&
git clone --depth 1 https://github.com/lavavu/Testing &&
cd Testing &&
export LV_CONTEXT=moderngl &&
export LV_ECHO_FAIL=1 &&
export LV_ARGS="-v" &&
python runall.py
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ $(OPATH)/compiler_flags: force | paths
paths:
@mkdir -p $(OPATH)
@mkdir -p $(PREFIX)
@mkdir -p $(PREFIX)/osmesa
@mkdir -p $(HTMLPATH)
@mkdir -p $(PREFIX)/shaders

Expand Down Expand Up @@ -256,6 +257,7 @@ endif
.PHONY: swig
swig : $(INC) src/LavaVuPython.i | paths
swig -v -Wextra -python -py3 -ignoremissing -O -c++ -DSWIG_DO_NOT_WRAP -outdir $(PREFIX) src/LavaVuPython.i
cd $(PREFIX)/osmesa; ln -sf ../LavaVuPython.py; touch __init__.py

$(SWIGLIB) : $(LIBRARY) $(SWIGOBJ)
-rm -f $(PREFIX)/_LavaVuPython.*
Expand Down
Loading

0 comments on commit 8e0f40c

Please sign in to comment.