-
Notifications
You must be signed in to change notification settings - Fork 50
43 lines (35 loc) · 1.37 KB
/
test-wheel-build.yml
File metadata and controls
43 lines (35 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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.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')"