From 2e7787f3624d5c02342c7977ae462e9b28d69451 Mon Sep 17 00:00:00 2001 From: Jared O'Neal Date: Fri, 15 May 2026 16:14:23 -0500 Subject: [PATCH 1/7] (Issue #187) Try using Texlive container. --- .github/workflows/build-docs.yml | 55 ++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index cb12160a..e96b4def 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -5,36 +5,51 @@ env: PDF_DOCS: ${{ github.workspace }}/docs/build_pdf on: push: - branches: [main, develop] + branches: main pull_request: - branches: [main, develop] + branches: main jobs: + # Get user/group of runner account so that subsequent jobs can run containers + # using that account rather than root. Based on discussions in: + # https://github.com/actions/runner/issues/691 + configure: + runs-on: ubuntu-latest + outputs: + uid_gid: ${{ steps.get_user.outputs.uid_gid }} + steps: + - id: get_user + run: | + MY_UID=$(id -u) + MY_GID=$(id -g) + echo "User = $(id -u -n) ($MY_UID)" + echo "Group = $(id -g -n) ($MY_GID)" + echo "uid_gid=$MY_UID:$MY_GID" >> "$GITHUB_OUTPUT" + build_pypkg_sphinx: - runs-on: ${{ matrix.os }} - strategy: - matrix: - # We would like to use 3.12, but this presently fails with the error: - # Could not import extension sphinxcontrib.bibtex (exception: No module named 'pkg_resources') - os: [ubuntu-latest] - python-version: ["3.11"] + # Prefer LaTeX installation by official image over manual installation to + # get more consistent and quick setup times. + runs-on: ubuntu-latest + needs: configure + env: + UID_GID: ${{ needs.configure.outputs.uid_gid }} + container: + image: texlive/texlive:latest + options: --user ${{ needs.configure.outputs.uid_gid }} steps: ##-- General Setup Steps - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + - name: Set up Python + uses: actions/setup-python@v6 with: - python-version: ${{ matrix.python-version }} - - - name: Install LaTeX - run: | - sudo apt-get update - sudo apt-get -y install texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra latexmk + python-version: 3.14 - name: Setup python with tox - run: $CLONE_PATH/.github/workflows/install_tox.sh - + run: | + echo "UID/GID from configure = $UID_GID" + echo "UID/GID actual = $(id -u):$(id -g)" + $CLONE_PATH/.github/workflows/install_tox.sh - name: Build sphinx docs run: | pushd $CLONE_PATH From 4c69214007cff0191f9fb81da6a499d03d441828 Mon Sep 17 00:00:00 2001 From: Jared O'Neal Date: Fri, 15 May 2026 16:24:24 -0500 Subject: [PATCH 2/7] (Issue #187) Adjust tox install to using Python in texlive container. --- .github/workflows/install_tox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/install_tox.sh b/.github/workflows/install_tox.sh index 340318d2..7dbb056f 100755 --- a/.github/workflows/install_tox.sh +++ b/.github/workflows/install_tox.sh @@ -10,7 +10,7 @@ which pip which tox echo python --version -pip --version tox --version echo -pip list +python -m pip list +echo From ef636bdb44bb9d96697b90573e30b951ebc5e92e Mon Sep 17 00:00:00 2001 From: Jared O'Neal Date: Fri, 15 May 2026 16:33:20 -0500 Subject: [PATCH 3/7] (Issue #187) pushd/popd not available in Texlive container. --- .github/workflows/build-docs.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index e96b4def..87213e40 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -52,13 +52,12 @@ jobs: $CLONE_PATH/.github/workflows/install_tox.sh - name: Build sphinx docs run: | - pushd $CLONE_PATH + cd $CLONE_PATH tox -r -e pdf,html - popd ##-- Make documents available as artifacts - name: Archive surmise docs - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: surmise-sphinx-docs path: | From c61523df1a062f6ca3ca673cf8555c3714f6d704 Mon Sep 17 00:00:00 2001 From: Jared O'Neal Date: Fri, 15 May 2026 16:48:48 -0500 Subject: [PATCH 4/7] (Issue #187) See if we can get a compiler. It appears that there is no prebuilt numpy 2.0.0 wheel available for the runner. Numpy's meson build system is complaining about not finding a compiler in our lightweight container. --- .github/workflows/build-docs.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 87213e40..43e03fa3 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -45,6 +45,13 @@ jobs: with: python-version: 3.14 + # numpy version needed to build package is old enough that it is being built + # from source, which requires a compiler. + - name: Install GCC + run: | + sudo apt-get update + sudo apt-get -y install gcc + - name: Setup python with tox run: | echo "UID/GID from configure = $UID_GID" From fa4f04ae074845ed12adce2cd7e32a8b381a5821 Mon Sep 17 00:00:00 2001 From: Jared O'Neal Date: Fri, 15 May 2026 16:57:56 -0500 Subject: [PATCH 5/7] (Issue #187) Try running the package manager directly. The command sudo was not found. --- .github/workflows/build-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 43e03fa3..cc744993 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -49,8 +49,8 @@ jobs: # from source, which requires a compiler. - name: Install GCC run: | - sudo apt-get update - sudo apt-get -y install gcc + apt-get update + apt-get -y install gcc - name: Setup python with tox run: | From f65ea4f639dd1ec9885a0f2db1229612a88b0a65 Mon Sep 17 00:00:00 2001 From: Jared O'Neal Date: Fri, 15 May 2026 17:10:15 -0500 Subject: [PATCH 6/7] (Issue #187) Last try... Couldn't install with apt-get without sudo. --- .github/workflows/build-docs.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index cc744993..04b24fd0 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -49,8 +49,9 @@ jobs: # from source, which requires a compiler. - name: Install GCC run: | - apt-get update - apt-get -y install gcc + apk update + apk add build-base + gcc --version - name: Setup python with tox run: | From 824d2fdcd501cbccb3a6802eb5cff5a180ab005b Mon Sep 17 00:00:00 2001 From: Jared O'Neal Date: Wed, 20 May 2026 07:34:55 -0500 Subject: [PATCH 7/7] (Issue #187) See if we can get this to work with numpy 2.1.2. This version was established as the correct version for surmise builds in main only recently. It was **not** chosen to get this functionality working. --- .github/workflows/build-docs.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 04b24fd0..518800d0 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -29,6 +29,11 @@ jobs: build_pypkg_sphinx: # Prefer LaTeX installation by official image over manual installation to # get more consistent and quick setup times. + # + # It's challenging at the very least to get a compiler suite installed in + # this container. Therefore, we need to choose the OS and Python version + # such that pip can install all packages (e.g., the numpy version needed to + # build the package) from prebuilt wheels. runs-on: ubuntu-latest needs: configure env: @@ -43,15 +48,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v6 with: - python-version: 3.14 - - # numpy version needed to build package is old enough that it is being built - # from source, which requires a compiler. - - name: Install GCC - run: | - apk update - apk add build-base - gcc --version + python-version: 3.13 - name: Setup python with tox run: |