-
Notifications
You must be signed in to change notification settings - Fork 35
Build pyOpenMS from source in Windows CI pipeline #313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 7 commits
7a81725
dd8a1e5
f663fb1
eef807b
3002044
7c13b76
33c1dea
e1707e8
3dbcc3c
2913429
2331566
152725d
b623ea5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,6 +57,16 @@ jobs: | |
| # https://github.com/actions/runner-images/blob/main/images/win/scripts/Installers/Install-GitHub-CLI.ps1 | ||
| echo "C:/Program Files (x86)/GitHub CLI" >> $GITHUB_PATH | ||
|
|
||
| - name: Set up Python for pyOpenMS build | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ env.PYTHON_VERSION }} | ||
|
|
||
| - name: Install pyOpenMS build dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install setuptools wheel "cython>=3.0.0" "autowrap>=0.24" "numpy>=1.24.0" pandas pytest | ||
|
|
||
| - name: Extract branch/PR infos | ||
| shell: bash | ||
| run: | | ||
|
|
@@ -139,11 +149,17 @@ jobs: | |
| ENABLE_TOPP_TESTING: "ON" | ||
| ENABLE_CLASS_TESTING: "ON" | ||
| WITH_GUI: "OFF" | ||
| WITH_PARQUET: "OFF" | ||
| WITH_PARQUET: "ON" | ||
| ADDRESS_SANITIZER: "Off" | ||
| BUILD_TYPE: "Release" | ||
| OPENMP: "Off" | ||
| USE_STATIC_BOOST: "On" | ||
| # pyOpenMS build settings | ||
| PYOPENMS: "ON" | ||
| PY_NUM_THREADS: "2" | ||
| PY_MEMLEAK_DISABLE: "On" | ||
| PY_NO_OPTIMIZATION: "ON" | ||
| Python_ROOT_DIR: "${{ runner.tool_cache }}/Python/${{ env.PYTHON_VERSION }}/x64" | ||
| # BUILD_FLAGS: "-p:CL_MPCount=2" # For VS Generator and MSBuild | ||
| BUILD_FLAGS: "-j2" # Ninja will otherwise use all cores (doesn't go well in GHA) | ||
| CMAKE_CCACHE_EXE: "ccache" | ||
|
|
@@ -161,6 +177,21 @@ jobs: | |
| CI_PROVIDER: "GitHub-Actions" | ||
| BUILD_NAME: "${{ env.RUN_NAME }}-Win64-class-topp-${{ github.run_number }}" | ||
|
|
||
| - name: Build pyOpenMS | ||
| shell: bash | ||
| run: | | ||
| cd $GITHUB_WORKSPACE/OpenMS/bld | ||
| cmake --build . --target pyopenms --config Release -- -j2 | ||
|
|
||
| - name: Test pyOpenMS | ||
| shell: bash | ||
| run: | | ||
| cd $GITHUB_WORKSPACE/OpenMS/bld/pyOpenMS | ||
| pip install dist/*.whl | ||
| python -c "import pyopenms; print(f'pyOpenMS version: {pyopenms.__version__}')" | ||
| # Run basic tests (skip tutorial tests which may require additional data) | ||
| pytest tests/ -v --ignore=tests/test_tutorial.py -x -q 2>&1 | head -100 | ||
|
Comment on lines
+190
to
+197
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Piping pytest output to In bash, the exit code of a pipeline is the exit code of the last command by default. When pytest fails but 🔧 Suggested fix using pipefail - name: Test pyOpenMS
shell: bash
run: |
+ set -o pipefail
cd $GITHUB_WORKSPACE/OpenMS/bld/pyOpenMS
pip install dist/*.whl
python -c "import pyopenms; print(f'pyOpenMS version: {pyopenms.__version__}')"
# Run basic tests (skip tutorial tests which may require additional data)
pytest tests/ -v --ignore=tests/test_tutorial.py -x -q 2>&1 | head -100🤖 Prompt for AI Agents |
||
|
|
||
| - name: Package | ||
| shell: bash | ||
| run: | | ||
|
|
@@ -178,6 +209,12 @@ jobs: | |
| name: openms-package | ||
| path: ${{ github.workspace }}/OpenMS/bld/*.zip | ||
|
|
||
| - name: Upload pyOpenMS wheel as artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: pyopenms-wheel | ||
| path: ${{ github.workspace }}/OpenMS/bld/pyOpenMS/dist/*.whl | ||
|
|
||
| build-executable: | ||
| runs-on: windows-2022 | ||
| needs: build-openms | ||
|
|
@@ -199,6 +236,12 @@ jobs: | |
| name: openms-package | ||
| path: openms-package | ||
|
|
||
| - name: Download pyOpenMS wheel | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: pyopenms-wheel | ||
| path: pyopenms-wheel | ||
|
|
||
| - name: Extract bin and share from package | ||
| run: | | ||
| cd openms-package | ||
|
|
@@ -248,6 +291,12 @@ jobs: | |
| - name: Install Required Packages | ||
| run: .\python-${{ env.PYTHON_VERSION }}\python -m pip install --force-reinstall -r requirements.txt --no-warn-script-location | ||
|
|
||
| - name: Install locally built pyOpenMS wheel | ||
| run: | | ||
| $wheel = Get-ChildItem -Path pyopenms-wheel -Filter "*.whl" | Select-Object -First 1 | ||
| Write-Host "Installing pyOpenMS wheel: $($wheel.FullName)" | ||
| .\python-${{ env.PYTHON_VERSION }}\python -m pip install $wheel.FullName --no-warn-script-location | ||
|
|
||
|
Comment on lines
+298
to
+303
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fail fast when the wheel artifact is missing. If no wheel exists, 🔧 Suggested fix - name: Install locally built pyOpenMS wheel
run: |
$wheel = Get-ChildItem -Path pyopenms-wheel -Filter "*.whl" | Select-Object -First 1
+ if (-not $wheel) { throw "pyOpenMS wheel not found in pyopenms-wheel/" }
Write-Host "Installing pyOpenMS wheel: $($wheel.FullName)"
.\python-${{ env.PYTHON_VERSION }}\python -m pip install $wheel.FullName --no-warn-script-location🤖 Prompt for AI Agents |
||
| - name: Set to offline deployment | ||
| run: | | ||
| $content = Get-Content -Raw settings.json | ConvertFrom-Json | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -19,6 +19,7 @@ jobs: | |||||
| run: | | ||||||
| python -m pip install --upgrade pip | ||||||
| pip install -r requirements.txt | ||||||
| pip install pyopenms | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pin pyopenms version to ensure compatibility with column name changes. The 🔧 Suggested fix- pip install pyopenms
+ pip install "pyopenms>=3.5.0"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| pip install pytest | ||||||
| - name: Running test cases | ||||||
| run: | | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Numpy version constraint inconsistent with requirements.txt.
Build dependencies specify
numpy>=1.24.0butrequirements.txtrequiresnumpy>=2.0.0. This inconsistency could lead to wheel compatibility issues if the build uses numpy 1.x while runtime expects 2.x.🔧 Suggested fix to align versions
🤖 Prompt for AI Agents