Skip to content

Fix wheel build test #2

Fix wheel build test

Fix wheel build test #2

# Tests that the package can be built and installed from a wheel
# Runs on PRs to catch build issues before merging to main
# Does NOT publish to PyPI
name: Test PIP Package Build
on:
pull_request:
branches:
- main
- develop
jobs:
test-build:
name: Test wheel build
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install build tools
run: python -m pip install build --user
- name: Build wheel and source distribution
run: python -m build --sdist --wheel --outdir dist/ .
- name: Test wheel installation
run: |
# Install the built wheel from dist/ to verify it was packaged correctly
# --find-links dist/ tells pip to look in dist/ directory first and prefer the wheel
# Dependencies (numpy, pandas, etc.) are fetched from PyPI as normal
# This verifies the wheel contains all necessary files and can be installed successfully
pip install 'mhkit[all]' --find-links dist/
python -c "from mhkit import wave, river, tidal, dolfyn, power, loads, mooring, acoustics, qc, utils; print('All modules imported successfully')"