-
Notifications
You must be signed in to change notification settings - Fork 34
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 all commits
7a81725
dd8a1e5
f663fb1
eef807b
3002044
7c13b76
33c1dea
e1707e8
3dbcc3c
2913429
2331566
152725d
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: | | ||
|
|
@@ -132,20 +142,28 @@ jobs: | |
| env: | ||
| OPENMS_CONTRIB_LIBS: "${{ github.workspace }}/OpenMS/contrib" | ||
| CI_PROVIDER: "GitHub-Actions" | ||
| CMAKE_GENERATOR: "Ninja" | ||
| CMAKE_GENERATOR: "Visual Studio 17 2022" | ||
| CMAKE_GENERATOR_PLATFORM: "x64" | ||
| SOURCE_DIRECTORY: "${{ github.workspace }}/OpenMS" | ||
| BUILD_NAME: "${{ env.RUN_NAME }}-Win64-class-topp-${{ github.run_number }}" | ||
| ENABLE_STYLE_TESTING: "OFF" | ||
| 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" | ||
| # 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) | ||
| # 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" | ||
| PYTHON_EXECUTABLE: "${{ runner.tool_cache }}/Python/${{ env.PYTHON_VERSION }}/x64/python.exe" | ||
| Python_FIND_STRATEGY: "LOCATION" | ||
| BUILD_FLAGS: "-p:CL_MPCount=2" | ||
| CMAKE_CCACHE_EXE: "ccache" | ||
| CCACHE_BASEDIR: ${{ github.workspace }} | ||
| CCACHE_DIR: ${{ github.workspace }}/.ccache | ||
|
|
@@ -160,6 +178,22 @@ jobs: | |
| SOURCE_DIRECTORY: "${{ github.workspace }}/OpenMS" | ||
| CI_PROVIDER: "GitHub-Actions" | ||
| BUILD_NAME: "${{ env.RUN_NAME }}-Win64-class-topp-${{ github.run_number }}" | ||
| BUILD_TYPE: "Release" | ||
|
|
||
| - name: Build pyOpenMS | ||
| shell: bash | ||
| run: | | ||
| cd $GITHUB_WORKSPACE/OpenMS/bld | ||
| cmake --build . --target pyopenms --config Release -- /p:CL_MPCount=2 /m:2 | ||
|
|
||
| - 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 | ||
|
|
||
| - name: Package | ||
| shell: bash | ||
|
|
@@ -178,6 +212,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 +239,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 +294,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
+297
to
+302
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.
Piping pytest output to
headmay mask test failures.In bash, the exit code of a pipeline is the exit code of the last command by default. When pytest fails but
head -100succeeds, the step may pass despite test failures. Consider usingset -o pipefailor capturing the exit code explicitly.🔧 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