Skip to content

Commit 77b133c

Browse files
authored
Actions: Remove --no-index from Wheel test build command (#424)
This is a fix for: https://github.com/MHKiT-Software/MHKiT-Python/actions/runs/18594536347/job/53017269068#step:6:14 ``` Run pip install 'mhkit[all]' --no-index --find-links dist/ Looking in links: dist/ Processing ./dist/mhkit-1.0.1-py3-none-any.whl INFO: pip is looking at multiple versions of mhkit[all] to determine which version is compatible with other requirements. This could take a while. ERROR: Could not find a version that satisfies the requirement numpy>=2.0.0 (from mhkit[all]) (from versions: none) ERROR: No matching distribution found for numpy>=2.0.0 Error: Process completed with exit code 1. ``` This fix removes `--no-index` which caused pip to only use local packages, which causes the above failure for any/all external packages/modules.
1 parent 0728e88 commit 77b133c

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

.github/workflows/pypi.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ jobs:
2929

3030
- name: Test wheel contents before upload
3131
run: |
32-
pip install 'mhkit[all]' --no-index --find-links dist/
32+
# Install the built wheel from dist/ to verify it was packaged correctly before upload
33+
# --find-links dist/ tells pip to look in dist/ directory first and prefer the wheel
34+
# Dependencies (numpy, pandas, etc.) are fetched from PyPI as normal
35+
# This verifies the wheel contains all necessary files and can be installed successfully
36+
pip install 'mhkit[all]' --find-links dist/
3337
python -c "from mhkit import wave, river, tidal, dolfyn, power, loads, mooring, acoustics, qc, utils; print('All modules imported successfully')"
3438
3539
- name: Upload to Test PyPI
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Tests that the package can be built and installed from a wheel
2+
# Runs on PRs to catch build issues before merging to main
3+
# Does NOT publish to PyPI
4+
5+
name: Test PIP Package Build
6+
7+
on:
8+
pull_request:
9+
branches:
10+
- main
11+
- develop
12+
13+
jobs:
14+
test-build:
15+
name: Test wheel build
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
python-version: ['3.10', '3.11', '3.12']
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
with:
24+
fetch-depth: 0
25+
26+
- uses: actions/setup-python@v2
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
30+
- name: Install build tools
31+
run: python -m pip install build --user
32+
33+
- name: Build wheel and source distribution
34+
run: python -m build --sdist --wheel --outdir dist/ .
35+
36+
- name: Test wheel installation
37+
run: |
38+
# Install the built wheel from dist/ to verify it was packaged correctly
39+
# --find-links dist/ tells pip to look in dist/ directory first and prefer the wheel
40+
# Dependencies (numpy, pandas, etc.) are fetched from PyPI as normal
41+
# This verifies the wheel contains all necessary files and can be installed successfully
42+
pip install 'mhkit[all]' --find-links dist/
43+
python -c "from mhkit import wave, river, tidal, dolfyn, power, loads, mooring, acoustics, qc, utils; print('All modules imported successfully')"

0 commit comments

Comments
 (0)