Skip to content

Additional fixes for py3.12: Fix Swin args, update docs workflow#124

Merged
C-Achard merged 3 commits into
mainfrom
cy/docs-fixes
May 20, 2026
Merged

Additional fixes for py3.12: Fix Swin args, update docs workflow#124
C-Achard merged 3 commits into
mainfrom
cy/docs-fixes

Conversation

@C-Achard
Copy link
Copy Markdown
Collaborator

@C-Achard C-Achard commented May 19, 2026

Scope

  • Fixes the outdated docs workflow
  • Changes the guard for old MONAI SwinUNetR API

Summary

This pull request updates the documentation build workflow and improves compatibility with dependencies in both the GitHub Actions workflow and the codebase. The main changes include a significant refactor of the documentation CI pipeline, a fix for SwinUNETR initialization to handle MONAI API changes, and a restriction on the jupyter-book version to avoid breaking changes.

Documentation workflow improvements:

  • .github/workflows/build_docs.yml: Refactored the GitHub Actions workflow for building and deploying documentation. The workflow now triggers on pushes and pull requests affecting documentation-related files, splits the build and deploy steps, adds concurrency controls, and uses the latest actions and Python 3.12. Deployment is handled with the official actions/deploy-pages action.

Dependency compatibility:

  • pyproject.toml: Restricted the jupyter-book dependency to versions below 2 to prevent incompatibility issues with breaking changes in newer versions.

Model initialization robustness:

C-Achard added 3 commits May 19, 2026 18:37
Improve SwinUNETR_ initializer error handling: when parent_init raises a TypeError, check for an 'img_size' kwarg and, if present, log a warning about MONAI API compatibility, remove 'img_size' and retry initialization. The previous fallback that forced in_channels=1 has been removed. If 'img_size' is not present, the original TypeError is re-raised so other errors are not silently swallowed.
Restrict the docs extra to "jupyter-book<2" instead of an unbounded "jupyter-book" to prevent automatic upgrades to jupyter-book 2.x, which may introduce breaking changes to the docs build and toolchain compatibility.
Replace the old single-job deploy workflow with a modern two-stage docs workflow: build and deploy. Adds path and pull_request triggers, workflow_dispatch support, concurrency, and read permissions for contents. The build job checks out code, sets up Python 3.12, installs docs dependencies, builds the Jupyter Book and uploads the HTML artifact (skip on PRs). The deploy job runs only on main (non-PR), requests pages and id-token permissions, sets the github-pages environment, and uses actions/deploy-pages@v4 to publish instead of the previous peaceiris action. Also modernizes action versions and enables pip caching.
@C-Achard C-Achard self-assigned this May 19, 2026
@C-Achard C-Achard added the documentation Improvements or additions to documentation label May 19, 2026
@C-Achard C-Achard marked this pull request as ready for review May 19, 2026 16:50
@C-Achard C-Achard merged commit 904bce8 into main May 20, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant