Skip to content

Building windows python wheels with fortran support#585

Merged
K20shores merged 11 commits intomainfrom
windows_build
Oct 22, 2025
Merged

Building windows python wheels with fortran support#585
K20shores merged 11 commits intomainfrom
windows_build

Conversation

@K20shores
Copy link
Copy Markdown
Collaborator

@K20shores K20shores commented Aug 15, 2025

Closes #590

  • The python tests actions now builds wheels for all operating system, and then uses these wheels to run the tests.
    • This is a much better because it more closely follow what a user might get from pypi
  • Added msys2 to provide the mingw build tools for windows which includes gfortran

Attempts

  • Attempted support for windows arm
    • LLVM's flang on windows arm for TUVx and CARMA
    • Abandoned since there were symbol visibility issues
  • Attempted and then abandoned rtools to provide mingw on windows which provides gfortran
    • Failed because we need to install other packages, and pacman intermittently failed with no easy resolution in sight

Other information
At first I tried to use rtools, like in scipy, so I heavily relied on what scipy does to support fortran on windows.

  • this workflow sets up Flang and pkg-config on arm windows. I made a similar one for amd based windows
  • Their testing action
  • Their windows action which helped me figure out how to configure windows to include a build that needs fortran. This also showed me that we should be building wheels, installing those wheels, and testing our files that way
  • Their repair bash script for wheel files

@github-actions
Copy link
Copy Markdown
Contributor

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Aug 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.24%. Comparing base (659886a) to head (0763aef).
⚠️ Report is 93 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #585   +/-   ##
=======================================
  Coverage   78.24%   78.24%           
=======================================
  Files          54       54           
  Lines        6857     6857           
=======================================
  Hits         5365     5365           
  Misses       1492     1492           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@K20shores K20shores changed the title trying to get fortraon to compile on windows Building windows python wheels with fortran support Aug 15, 2025
@K20shores K20shores force-pushed the windows_build branch 2 times, most recently from 510df30 to 80fd4f0 Compare October 22, 2025 14:47
@K20shores K20shores marked this pull request as ready for review October 22, 2025 15:33
@K20shores K20shores requested a review from Copilot October 22, 2025 15:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables building Windows Python wheels with Fortran support by configuring MSYS2 with MinGW64 toolchain. The changes allow the CI/CD pipeline to build, repair, and test wheels across all supported platforms (Linux, macOS, Windows) more consistently with what users will receive from PyPI.

Key changes:

  • Added MSYS2/MinGW64 setup for Windows CI to provide gfortran compiler
  • Implemented wheel building and testing workflow that mirrors user installation experience
  • Removed platform-specific restrictions that disabled TUVX and CARMA on Windows

Reviewed Changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
python/musica/tools/repair_wheel_windows.sh New script to repair Windows wheels using delvewheel
python/musica/tools/prepare_build_environment_windows.bat Contains unresolved merge conflict markers
python/musica/test/integration/test_sulfate_box_model.py Removed emoji from test output message
pyproject.toml Enabled Windows builds, added wheel repair configuration, updated dependencies formatting
include/musica/carma/error.hpp Removed duplicate #pragma once directive
CMakeLists.txt Disabled CMake module scanning on macOS
.github/workflows/windows.yml Migrated MinGW setup to composite action
.github/workflows/python-wheels.yml Updated to build Windows wheels using MSYS2 environment
.github/workflows/python-tests.yml Refactored to build and test wheels instead of direct installation
.github/windows_arm64_steps/action.yml New composite action for ARM64 Windows setup (currently unused)
.github/windows_amd64_steps/action.yml New composite action for AMD64 Windows setup with MSYS2

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@K20shores K20shores requested a review from boulderdaze October 22, 2025 15:58
@K20shores K20shores merged commit 2f59d9b into main Oct 22, 2025
107 of 109 checks passed
@K20shores K20shores deleted the windows_build branch October 22, 2025 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include fortran builds on windows

4 participants