Skip to content

docs: use a lean conda env for Read the Docs builds - #92

Merged
steven-murray merged 1 commit into
mainfrom
fix-rtd-lean-env
Oct 6, 2026
Merged

steven-murray merged 1 commit into
mainfrom
fix-rtd-lean-env

Conversation

@steven-murray

@steven-murray steven-murray commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Every Read the Docs build since mid-2024, for PRs and for latest/main alike, has been killed at RTD's 15-minute limit while running mamba env create --file ci/test-env.yml. The last successful build was 24721410 on 2024-06-17. Recent examples: 34949820 (#91) and 34975639 (latest at 7b35331).

ci/test-env.yml is too expensive to solve within that limit. It uses three channels (including the old conda-forge/label/cf201901), pulls in all the samplers and test tooling, and leaves python and 21cmFAST unpinned. A dry-run solve takes about 11 minutes locally with micromamba 2.9, and longer with the mamba 1.x in RTD's mambaforge-23.11 image.

Changes

  • New docs/environment.yaml, conda-forge only: python=3.11, pip, 21cmfast>=3.3,<4 (needs conda for FFTW/GSL), and pytorch-cpu (stops pip pulling CUDA torch for py21cmemu). RTD's existing pip install .[docs] supplies everything else.
  • .readthedocs.yml now points conda.environment at the new file, with a comment explaining why.

ci/test-env.yml is unchanged.

Verified locally

  • The new env solves in about 5s.
  • After pip install .[docs], py21cmfast, py21cmmc and torch all import.
  • sphinx-build -b html docs succeeds with 21 warnings. These come from existing docs content: bad link targets in AUTHORS.rst, and a duplicate "Notes" section that stops Core21cmEMU from being autodoc'd.

Follow-up: INSTALLATION.rst still points users at the slow ci/test-env.yml.

🤖 Generated with Claude Code

Summary by Sourcery

Configure Read the Docs to build documentation with a lean, conda-forge-only environment that avoids timeout-prone dependency solving.

Bug Fixes:

  • Restore Read the Docs builds by replacing the slow full test environment with a lightweight documentation-specific environment that solves within the build time limit.

Enhancements:

  • Pin the documentation environment to Python 3.11 and provide the conda dependencies required for 21cmFAST and CPU-only PyTorch.
  • Keep the full CI test environment unchanged while allowing documentation dependencies to be installed separately through the existing docs extra.

Documentation:

  • Configure Read the Docs to use the new lean documentation environment.

Every RTD build since mid-2024 (including main/latest) has been killed at
RTD's 15-minute limit while running `mamba env create -f ci/test-env.yml`:
that env (three channels incl. the old conda-forge/label/cf201901, all
samplers and test tooling, unpinned python and 21cmFAST) is too expensive
to solve (~11 min even with micromamba 2.9 locally, longer with the
mamba 1.x shipped in RTD's mambaforge-23.11 image).

Add docs/environment.yaml with just python 3.11, pip, 21cmfast<4 (needs
conda for FFTW/GSL) and pytorch-cpu (avoids pip pulling CUDA torch for
py21cmemu), all from conda-forge; RTD's existing pip install of `.[docs]`
supplies the rest. Solves in ~5s and a local sphinx build succeeds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@steven-murray steven-murray added type: ci Updates to CI (GH actions, RTD, codecov, etc.) type: maint: documentation Improvements or additions to documentation labels Oct 6, 2026
@sourcery-ai

sourcery-ai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Introduces a lean, conda-forge-only documentation environment with pinned Python and constrained 21cmFAST, then configures Read the Docs to use it instead of the expensive full test environment. The existing pip docs installation remains responsible for the rest of the documentation toolchain, improving build solve time without changing CI test dependencies.

File-Level Changes

Change Details Files
Replace the slow CI environment with a minimal, pinned conda environment for documentation builds.
  • Add a conda-forge-only environment with Python 3.11, pip, 21cmFAST constrained to the supported 3.x range, and CPU-only PyTorch.
  • Keep compiled 21cmFAST dependencies in conda while relying on the existing pip docs extra for remaining documentation dependencies.
docs/environment.yaml
Configure Read the Docs to use the lean documentation environment.
  • Point the RTD conda configuration at the new documentation environment.
  • Document that the full test environment exceeds RTD’s 15-minute dependency-solving limit.
.readthedocs.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.99%. Comparing base (e28fc83) to head (105a013).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #92   +/-   ##
=======================================
  Coverage   73.99%   73.99%           
=======================================
  Files           8        8           
  Lines        2123     2123           
=======================================
  Hits         1571     1571           
  Misses        552      552           
Flag Coverage Δ
unittests 73.99% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@steven-murray steven-murray self-assigned this Oct 6, 2026
@steven-murray
steven-murray merged commit b589561 into main Oct 6, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: ci Updates to CI (GH actions, RTD, codecov, etc.) type: maint: documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant