Skip to content

Add Windows as a supported platform (CI green on windows-latest)#1

Merged
wshlavacek merged 4 commits into
mainfrom
windows-support
Jul 5, 2026
Merged

Add Windows as a supported platform (CI green on windows-latest)#1
wshlavacek merged 4 commits into
mainfrom
windows-support

Conversation

@wshlavacek

@wshlavacek wshlavacek commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Makes ssys build and pass CI on Windows, and advertises Windows as a supported platform. windows-latest is re-added to both the test and artifact-smoke matrices (Python 3.10/3.11/3.12), joining Linux and macOS.

Re-adding the Windows runners surfaced a handful of Windows-only failures, each fixed below.

Fixes

  • CLI Unicode output (src/ssys/cli.py): reconfigure stdout/stderr to UTF-8 in main() so the status lines (and any Greek letters / arrows) no longer raise UnicodeEncodeError under the Windows cp1252 console/pipe encoding. This unblocked both the CLI subprocess integration test and the wheel/sdist artifact-smoke jobs.
  • Numerical validator budget (src/ssys/_validator/numerical.py): use a strict < comparison in the sample-evaluation budget check so a zero-second budget always trips, even where time.monotonic() has coarse resolution and reports elapsed == 0.0 at the first check.
  • Cross-platform timeout (biomodels_batch/utils.py): signal.alarm/SIGALRM are Unix-only. They stay on Unix; on Windows the timeout falls back to a worker-thread join, preserving shared-argument mutation and TimeoutError semantics.
  • High-resolution recast timing (biomodels_batch/step3_recast.py): measure the recast elapsed with time.perf_counter() instead of time.time(), matching the phase timing inside attempt_recast. time.time()'s ~15 ms resolution on Windows could report 0.0 elapsed and suppress the open-phase interval used to attribute timeouts.
  • PATH separator (tools/run_biomodels_benchmark.py): build the isolated-environment PATH with os.pathsep instead of a hardcoded :, which split C:\... on Windows.
  • Test portability (tests/): write the evidence fixture with newline="\n" so its on-disk byte size is stable across platforms, and split PATH on os.pathsep.

Advertising

  • pyproject.toml: add the Operating System :: Microsoft :: Windows classifier.
  • README.md: update the supported-platforms note to include Windows.

Verification

All CI jobs are green on windows-latest, ubuntu-latest, and macos-latest (3.10/3.11/3.12), including the type-check, build, artifact-smoke, sdist-artifact-smoke, and slow Linux integration jobs. The Windows-only timeout thread path was additionally exercised locally by forcing the no-SIGALRM branch.

Re-adding windows-latest to the CI matrices surfaced five Windows-only
failures. Fixes:

- cli: reconfigure stdout/stderr to UTF-8 in main() so the "✓" status
  lines (and any Greek letters/arrows) no longer raise UnicodeEncodeError
  under the cp1252 console/pipe encoding. This unblocks both the CLI
  subprocess integration test and the wheel/sdist artifact smoke jobs.
- numerical validator: use a strict "<" comparison in the sample
  evaluation budget check so a zero-second budget always trips, even
  where time.monotonic() has coarse resolution and reports elapsed == 0.0.
- biomodels_batch/utils: make the timeout mechanism cross-platform.
  signal.alarm/SIGALRM stay on Unix; Windows falls back to a worker-thread
  join, preserving shared-argument mutation and TimeoutError semantics.
- run_biomodels_benchmark: build the isolated-env PATH with os.pathsep
  instead of a hardcoded ":", which split "C:\..." on Windows.
- tests: write the evidence fixture with newline="\n" so its on-disk byte
  size is stable across platforms, and split PATH on os.pathsep.
process_model timed the recast with time.time(), whose ~15 ms resolution on
Windows can report a 0.0 elapsed for a fast recast. That zeroed the
open-phase interval used to attribute a timeout to its in-flight phase,
leaving recast_dominant_phase empty. Use time.perf_counter(), matching the
high-resolution phase timing already used inside attempt_recast.
Windows (3.10/3.11/3.12) now passes CI alongside Linux and macOS, so add the
Windows operating-system classifier and update the README platform note.
@wshlavacek wshlavacek marked this pull request as ready for review July 5, 2026 08:51
@wshlavacek wshlavacek changed the title Windows support: pass CI on windows-latest Add Windows as a supported platform (CI green on windows-latest) Jul 5, 2026
@wshlavacek wshlavacek merged commit 453215d into main Jul 5, 2026
22 checks passed
@wshlavacek wshlavacek deleted the windows-support branch July 5, 2026 09:06
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.

1 participant