Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ jobs:

- name: Test wheel contents before upload
run: |
pip install 'mhkit[all]' --no-index --find-links dist/
# Install the built wheel from dist/ to verify it was packaged correctly before upload
# --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')"

- name: Upload to Test PyPI
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/test-wheel-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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')"
Loading