From ebd3ae94bca32af32c6b7ff1de48b97b40999361 Mon Sep 17 00:00:00 2001 From: nikitakuklev Date: Fri, 14 Aug 2026 03:17:26 -0500 Subject: [PATCH 1/7] ci: expand test platform matrix --- .github/workflows/tests.yml | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 974658d47..0562645bb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,13 +23,19 @@ jobs: max-deletions: 3 test: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - python-version: ["3.11", "3.12", "3.13"] + os: [ubuntu-latest] + python-version: ["3.11", "3.12", "3.13", "3.14"] + include: + - os: macos-latest + python-version: "3.13" + - os: windows-latest + python-version: "3.13" - name: Python ${{ matrix.python-version }} + name: ${{ matrix.os }} / Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v4 with: @@ -44,9 +50,24 @@ jobs: - name: Set up Python ${{ matrix.python-version }} run: uv python install ${{ matrix.python-version }} - - name: Install system dependencies + - name: Install system dependencies (Ubuntu) + if: runner.os == 'Linux' run: sudo apt-get update && sudo apt-get install -y libopenmpi-dev + - name: Install system dependencies (macOS) + if: runner.os == 'macOS' + run: brew install open-mpi + + - name: Install system dependencies (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + choco install msmpi --yes --no-progress + "MSMPI_BIN=C:\Program Files\Microsoft MPI\Bin" | + Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + "C:\Program Files\Microsoft MPI\Bin" | + Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + - name: Install dependencies run: uv sync --extra dev @@ -54,6 +75,8 @@ jobs: run: uv pip list - name: Run tests + env: + COVERAGE_FILE: ${{ runner.temp }}/.coverage run: uv run pytest -n auto --cov --cov-branch --cov-report=xml - name: Upload coverage to Codecov From f88c4132b24a760d221aaba632564af6b0a28af0 Mon Sep 17 00:00:00 2001 From: nikitakuklev Date: Fri, 14 Aug 2026 03:24:09 -0500 Subject: [PATCH 2/7] ci: use cross-platform MPI setup --- .github/workflows/tests.yml | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0562645bb..8457f6c2a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -37,12 +37,12 @@ jobs: name: ${{ matrix.os }} / Python ${{ matrix.python-version }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: fetch-depth: 1 - name: Set up uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@v10 with: enable-cache: true cache-dependency-glob: "**/pyproject.toml" @@ -50,23 +50,8 @@ jobs: - name: Set up Python ${{ matrix.python-version }} run: uv python install ${{ matrix.python-version }} - - name: Install system dependencies (Ubuntu) - if: runner.os == 'Linux' - run: sudo apt-get update && sudo apt-get install -y libopenmpi-dev - - - name: Install system dependencies (macOS) - if: runner.os == 'macOS' - run: brew install open-mpi - - - name: Install system dependencies (Windows) - if: runner.os == 'Windows' - shell: pwsh - run: | - choco install msmpi --yes --no-progress - "MSMPI_BIN=C:\Program Files\Microsoft MPI\Bin" | - Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - "C:\Program Files\Microsoft MPI\Bin" | - Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + - name: Set up MPI + uses: mpi4py/setup-mpi@v1 - name: Install dependencies run: uv sync --extra dev From 5ba8265f4f21663ef5d8b1511acb4a9ce3ba9342 Mon Sep 17 00:00:00 2001 From: nikitakuklev Date: Fri, 14 Aug 2026 03:26:28 -0500 Subject: [PATCH 3/7] ci: pin published action versions --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8457f6c2a..39e1fca59 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -37,12 +37,12 @@ jobs: name: ${{ matrix.os }} / Python ${{ matrix.python-version }} steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@v7.0.1 with: fetch-depth: 1 - name: Set up uv - uses: astral-sh/setup-uv@v10 + uses: astral-sh/setup-uv@v10.0.0 with: enable-cache: true cache-dependency-glob: "**/pyproject.toml" @@ -51,7 +51,7 @@ jobs: run: uv python install ${{ matrix.python-version }} - name: Set up MPI - uses: mpi4py/setup-mpi@v1 + uses: mpi4py/setup-mpi@v1.4.4 - name: Install dependencies run: uv sync --extra dev From 2010ce1fd7f65a9fb4ce8958d1badd80542b7016 Mon Sep 17 00:00:00 2001 From: nikitakuklev Date: Fri, 14 Aug 2026 03:29:24 -0500 Subject: [PATCH 4/7] ci: select MPI implementation by platform --- .github/workflows/tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 39e1fca59..4579c30b4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,11 +29,14 @@ jobs: matrix: os: [ubuntu-latest] python-version: ["3.11", "3.12", "3.13", "3.14"] + mpi: [openmpi] include: - os: macos-latest python-version: "3.13" + mpi: openmpi - os: windows-latest python-version: "3.13" + mpi: msmpi name: ${{ matrix.os }} / Python ${{ matrix.python-version }} steps: @@ -52,6 +55,8 @@ jobs: - name: Set up MPI uses: mpi4py/setup-mpi@v1.4.4 + with: + mpi: ${{ matrix.mpi }} - name: Install dependencies run: uv sync --extra dev From c6d8a26fd9d6f93b424920b14931ffb3cfea0702 Mon Sep 17 00:00:00 2001 From: nikitakuklev Date: Fri, 14 Aug 2026 03:40:53 -0500 Subject: [PATCH 5/7] test: close file logging handler --- xopt/tests/test_log.py | 1 + 1 file changed, 1 insertion(+) diff --git a/xopt/tests/test_log.py b/xopt/tests/test_log.py index 9d0b6aa14..1b5c60aeb 100644 --- a/xopt/tests/test_log.py +++ b/xopt/tests/test_log.py @@ -36,6 +36,7 @@ def test_set_handler_with_logger_file(): logger.info("file test message") handler.flush() logger.removeHandler(handler) + handler.close() with open(tmp.name) as f: contents = f.read() assert "file test message" in contents From c3133e10032242d2cf45bafd295cc6e4847c860c Mon Sep 17 00:00:00 2001 From: nikitakuklev Date: Fri, 14 Aug 2026 03:44:02 -0500 Subject: [PATCH 6/7] ci: initialize MSVC for Windows tests --- .github/workflows/tests.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4579c30b4..8c3ef5841 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -64,11 +64,33 @@ jobs: - name: List Python package versions run: uv pip list - - name: Run tests + - name: Run tests (Linux and macOS) + if: runner.os != 'Windows' env: COVERAGE_FILE: ${{ runner.temp }}/.coverage run: uv run pytest -n auto --cov --cov-branch --cov-report=xml + - name: Run tests (Windows) + if: runner.os == 'Windows' + shell: pwsh + env: + COVERAGE_FILE: ${{ runner.temp }}/.coverage + run: | + $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" + $vsPath = & $vswhere -latest -products * ` + -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ` + -property installationPath + + if (-not $vsPath) { + throw "MSVC installation not found" + } + + $devShell = Join-Path $vsPath "Common7\Tools\Launch-VsDevShell.ps1" + & $devShell -Arch amd64 -HostArch amd64 -SkipAutomaticLocation + Get-Command cl -ErrorAction Stop + + uv run pytest -n auto --cov --cov-branch --cov-report=xml + - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: From 829391df61cce97138a18a057a58e099dcbae1d2 Mon Sep 17 00:00:00 2001 From: nikitakuklev Date: Fri, 14 Aug 2026 04:13:12 -0500 Subject: [PATCH 7/7] Update GitHub Actions workflows --- .github/workflows/gh-pages.yml | 26 ++++++++++++++------------ .github/workflows/lint.yml | 11 ++++------- .github/workflows/pypi_upload.yml | 6 +++--- .github/workflows/test-notebooks.yml | 14 ++++++++------ .github/workflows/tests.yml | 2 +- 5 files changed, 30 insertions(+), 29 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 0b43f3965..90833a38c 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -26,12 +26,12 @@ jobs: group: [1, 2, 3, 4] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7.0.1 with: fetch-depth: 1 - name: Set up uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@v10.0.0 with: enable-cache: true cache-dependency-glob: "**/pyproject.toml" @@ -39,8 +39,10 @@ jobs: - name: Set up Python run: uv python install 3.12 - - name: Install system dependencies - run: sudo apt-get update && sudo apt-get install -y libopenmpi-dev + - name: Set up MPI + uses: mpi4py/setup-mpi@v1.4.4 + with: + mpi: openmpi - name: Install dependencies run: uv sync --extra dev @@ -206,14 +208,14 @@ jobs: - name: Upload results artifact if: always() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7.0.1 with: name: notebook-results-group-${{ matrix.group }} path: results/group-${{ matrix.group }}-results.txt - name: Upload executed notebooks if: always() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7.0.1 with: name: executed-notebooks-group-${{ matrix.group }} path: executed-notebooks/**/*.ipynb @@ -228,7 +230,7 @@ jobs: if: always() steps: - name: Download all results - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8.0.1 with: pattern: notebook-results-group-* merge-multiple: true @@ -284,12 +286,12 @@ jobs: name: "Build Documentation" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7.0.1 with: fetch-depth: 0 # Required for setuptools_scm version calculation - name: Set up uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@v10.0.0 with: enable-cache: true cache-dependency-glob: "**/pyproject.toml" @@ -301,7 +303,7 @@ jobs: run: uv sync --extra doc - name: Download executed notebooks - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8.0.1 with: pattern: executed-notebooks-group-* path: downloaded-notebooks @@ -332,7 +334,7 @@ jobs: mv xopt-examples.zip ./site/assets/ - name: Upload docs artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@v5.0.0 with: path: ./site @@ -350,4 +352,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v5.0.0 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0fa20cf13..4bf70208a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,25 +22,22 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7.0.1 with: fetch-depth: 1 - name: Install uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@v10.0.0 with: enable-cache: true cache-dependency-glob: "**/pyproject.toml" - - name: Set up Python ${{ matrix.python-version }} - run: uv python install ${{ matrix.python-version }} + - name: Set up Python 3.13 + run: uv python install 3.13 - name: Install dependencies run: uv sync --extra dev - - name: Install pre-commit - run: uv pip install pre-commit - - name: List Python package versions run: uv pip list diff --git a/.github/workflows/pypi_upload.yml b/.github/workflows/pypi_upload.yml index b40bc972c..4ab0909ad 100644 --- a/.github/workflows/pypi_upload.yml +++ b/.github/workflows/pypi_upload.yml @@ -11,11 +11,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v7.0.1 with: fetch-depth: 0 - name: Set up Python 3.11 - uses: actions/setup-python@v1 + uses: actions/setup-python@v7.0.0 with: python-version: 3.11 - name: Install pypa/build @@ -31,6 +31,6 @@ jobs: --outdir dist/ . - name: Publish distribution to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + uses: pypa/gh-action-pypi-publish@v1.14.2 with: password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/test-notebooks.yml b/.github/workflows/test-notebooks.yml index b308c91c8..64ddf12b1 100644 --- a/.github/workflows/test-notebooks.yml +++ b/.github/workflows/test-notebooks.yml @@ -29,10 +29,10 @@ jobs: group: [1, 2, 3, 4] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7.0.1 - name: Set up uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@v10.0.0 with: enable-cache: true cache-dependency-glob: "**/pyproject.toml" @@ -40,8 +40,10 @@ jobs: - name: Set up Python run: uv python install 3.12 - - name: Install system dependencies - run: sudo apt-get update && sudo apt-get install -y libopenmpi-dev + - name: Set up MPI + uses: mpi4py/setup-mpi@v1.4.4 + with: + mpi: openmpi - name: Install dependencies run: uv sync --extra dev @@ -202,7 +204,7 @@ jobs: - name: Upload results artifact if: always() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7.0.1 with: name: results-group-${{ matrix.group }} path: results/group-${{ matrix.group }}-results.txt @@ -214,7 +216,7 @@ jobs: if: always() steps: - name: Download all results - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8.0.1 with: pattern: results-group-* merge-multiple: true diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8c3ef5841..e26226a09 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -92,6 +92,6 @@ jobs: uv run pytest -n auto --cov --cov-branch --cov-report=xml - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@v7.0.0 with: token: ${{ secrets.CODECOV_TOKEN }}