Skip to content

Commit 43d8c32

Browse files
authored
Merge branch 'main' into np_regression
2 parents badba20 + 76c27bd commit 43d8c32

File tree

234 files changed

+27677
-18125
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

234 files changed

+27677
-18125
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

+12
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,18 @@ body:
4848
description: What operating system are you using?
4949
validations:
5050
required: false
51+
- type: textarea
52+
id: suggested-fix
53+
attributes:
54+
label: (Optional) Describe any potential fixes you've considered to the issue outlined above.
55+
- type: dropdown
56+
id: pull-request
57+
attributes:
58+
label: Pull Request
59+
description: Are you willing to open a pull request fixing the bug outlined in this issue? (See [Contributing to BoTorch](https://github.com/pytorch/botorch/blob/main/CONTRIBUTING.md))
60+
options:
61+
- "Yes"
62+
- "No"
5163
- type: checkboxes
5264
id: terms
5365
attributes:

.github/workflows/deploy_on_release.yml

+46-9
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,24 @@ jobs:
2020
runs-on: ubuntu-latest
2121
permissions:
2222
id-token: write # This is required for PyPI OIDC authentication.
23+
env:
24+
# `uv pip ...` requires venv by default. This skips that requirement.
25+
UV_SYSTEM_PYTHON: 1
2326
needs: tests-and-coverage
2427
steps:
2528
- uses: actions/checkout@v4
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v5
2631
- name: Fetch all history for all tags and branches
2732
run: git fetch --prune --unshallow
2833
- name: Set up Python
2934
uses: actions/setup-python@v5
3035
with:
31-
python-version: "3.10"
36+
python-version: "3.13"
3237
- name: Install dependencies
3338
run: |
34-
pip install .[test]
35-
pip install --upgrade build setuptools setuptools_scm wheel
39+
uv pip install .[test]
40+
uv pip install --upgrade build setuptools setuptools_scm wheel
3641
- name: Build packages (wheel and source distribution)
3742
run: |
3843
python -m build --sdist --wheel
@@ -44,11 +49,43 @@ jobs:
4449
with:
4550
verbose: true
4651

47-
publish-versioned-website:
48-
name: Publish versioned website
52+
check-versions:
4953
needs: package-deploy-pypi
50-
uses: ./.github/workflows/reusable_website.yml
54+
name: Check if major or minor version changed
55+
runs-on: ubuntu-latest
56+
outputs:
57+
major_minor_changed: ${{ steps.compare.outputs.major_minor_changed }}
58+
steps:
59+
- uses: actions/checkout@v4
60+
with:
61+
fetch-depth: 0
62+
fetch-tags: true
63+
ref: ${{ github.sha }}
64+
- name: Check if major or minor version changed
65+
id: compare
66+
run: |
67+
git fetch --tags --force
68+
previous_version=$(git describe --tags --abbrev=0 ${{ github.event.release.tag_name }}^)
69+
prev=$(cut -d '.' -f 1-2 <<< $previous_version) # remove patch number
70+
prev=${prev#v} # remove optional "v" prefix
71+
next=$(cut -d '.' -f 1-2 <<< ${{ github.event.release.tag_name }})
72+
next=${next#v}
73+
74+
echo "Updating from version $previous_version to ${{ github.event.release.tag_name }}"
75+
if [[ "$prev" == "$next" ]]; then
76+
echo "::warning::Major/Minor version was not changed. Skipping website & docs generation step."
77+
else
78+
echo major_minor_changed=true >> $GITHUB_OUTPUT
79+
fi
80+
81+
version-and-publish-website:
82+
needs: check-versions
83+
name: Version and Publish website
84+
if: ${{ needs.check-versions.outputs.major_minor_changed == 'true' }}
85+
uses: ./.github/workflows/publish_website.yml
5186
with:
52-
publish_versioned_website: true
53-
release_tag: ${{ github.event.release.tag_name }}
54-
secrets: inherit
87+
new_version: ${{ github.event.release.tag_name }}
88+
permissions:
89+
pages: write
90+
id-token: write
91+
contents: write

.github/workflows/docs.yml

+10-6
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,24 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
fail-fast: false
18+
env:
19+
# `uv pip ...` requires venv by default. This skips that requirement.
20+
UV_SYSTEM_PYTHON: 1
1821
steps:
1922
- uses: actions/checkout@v4
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v5
2025
- name: Set up Python
2126
uses: actions/setup-python@v5
2227
with:
23-
python-version: "3.10"
28+
python-version: "3.13"
2429
- name: Install dependencies
2530
env:
2631
ALLOW_LATEST_GPYTORCH_LINOP: true
2732
run: |
28-
pip install git+https://github.com/cornellius-gp/linear_operator.git
29-
pip install git+https://github.com/cornellius-gp/gpytorch.git
30-
pip install .[dev]
31-
pip install beautifulsoup4 ipython nbconvert jinja2
33+
uv pip install git+https://github.com/cornellius-gp/linear_operator.git
34+
uv pip install git+https://github.com/cornellius-gp/gpytorch.git
35+
uv pip install ."[dev, tutorials]"
3236
- name: Validate Sphinx
3337
run: |
3438
python scripts/validate_sphinx.py -p "$(pwd)"
@@ -38,4 +42,4 @@ jobs:
3842
sphinx-build -WT --keep-going sphinx/source sphinx/build
3943
- name: Validate and parse tutorials
4044
run: |
41-
python scripts/parse_tutorials.py -w "$(pwd)"
45+
python scripts/convert_ipynb_to_mdx.py --clean

.github/workflows/lint.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,20 @@ jobs:
1212

1313
lint:
1414
runs-on: ubuntu-latest
15+
env:
16+
# `uv pip ...` requires venv by default. This skips that requirement.
17+
UV_SYSTEM_PYTHON: 1
1518
steps:
1619
- uses: actions/checkout@v4
17-
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v5
1822
- name: Set up Python
1923
uses: actions/setup-python@v5
2024
with:
21-
python-version: "3.10"
25+
python-version: "3.13"
2226

2327
- name: Install dependencies
24-
run: pip install pre-commit
28+
run: uv pip install pre-commit
2529

2630
- name: Run pre-commit
2731
run: pre-commit run --all-files --show-diff-on-failure

.github/workflows/nightly.yml

+17-12
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,28 @@ jobs:
2020
runs-on: ubuntu-latest
2121
permissions:
2222
id-token: write # This is required for PyPI OIDC authentication.
23+
env:
24+
# `uv pip ...` requires venv by default. This skips that requirement.
25+
UV_SYSTEM_PYTHON: 1
2326
steps:
2427
- uses: actions/checkout@v4
2528
- name: Fetch all history for all tags and branches
2629
run: git fetch --prune --unshallow
30+
- name: Install uv
31+
uses: astral-sh/setup-uv@v5
2732
- name: Set up Python
2833
uses: actions/setup-python@v5
2934
with:
30-
python-version: "3.10"
35+
python-version: "3.13"
3136
- name: Install dependencies
3237
env:
3338
ALLOW_LATEST_GPYTORCH_LINOP: true
3439
run: |
35-
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
36-
pip install git+https://github.com/cornellius-gp/linear_operator.git
37-
pip install git+https://github.com/cornellius-gp/gpytorch.git
38-
pip install .[test]
39-
pip install --upgrade build setuptools setuptools_scm wheel
40+
uv pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
41+
uv pip install git+https://github.com/cornellius-gp/linear_operator.git
42+
uv pip install git+https://github.com/cornellius-gp/gpytorch.git
43+
uv pip install .[test]
44+
uv pip install --upgrade build setuptools setuptools_scm wheel
4045
- name: Extract reduced version and save to env var
4146
# strip the commit hash from the version to enable upload to pypi
4247
# env var will persist for subsequent steps
@@ -63,15 +68,15 @@ jobs:
6368
publish-latest-website:
6469
name: Publish latest website
6570
needs: [tests-and-coverage-nightly, package-test-deploy-pypi]
66-
uses: ./.github/workflows/reusable_website.yml
67-
with:
68-
publish_versioned_website: false
69-
secrets: inherit
71+
uses: ./.github/workflows/publish_website.yml
72+
permissions:
73+
pages: write
74+
id-token: write
75+
contents: write
7076

7177
run_tutorials:
72-
name: Run tutorials without smoke test on latest PyTorch / GPyTorch / Ax
78+
name: Run tutorials without smoke test on latest PyTorch / GPyTorch
7379
uses: ./.github/workflows/reusable_tutorials.yml
7480
with:
7581
smoke_test: false
7682
use_stable_pytorch_gpytorch: false
77-
use_stable_ax: false

.github/workflows/publish_website.yml

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Publish Website
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
new_version:
7+
required: false
8+
type: string
9+
run_tutorials:
10+
required: false
11+
type: boolean
12+
default: false
13+
workflow_dispatch:
14+
15+
16+
jobs:
17+
18+
build-website:
19+
runs-on: ubuntu-latest
20+
env:
21+
# `uv pip ...` requires venv by default. This skips that requirement.
22+
UV_SYSTEM_PYTHON: 1
23+
permissions:
24+
contents: write
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
ref: 'docusaurus-versions' # release branch
29+
fetch-depth: 0
30+
- name: Install uv
31+
uses: astral-sh/setup-uv@v5
32+
- name: Sync release branch with main
33+
run: |
34+
git config --global user.name "github-actions[bot]"
35+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
36+
git merge origin/main
37+
# To avoid a large number of commits we don't push this sync commit to github until a new release.
38+
- name: Set up Python
39+
uses: actions/setup-python@v5
40+
with:
41+
python-version: "3.13"
42+
- if: ${{ !inputs.new_version }}
43+
name: Install latest GPyTorch and Linear Operator
44+
run: |
45+
uv pip install git+https://github.com/cornellius-gp/linear_operator.git
46+
uv pip install git+https://github.com/cornellius-gp/gpytorch.git
47+
- name: Install dependencies
48+
env:
49+
ALLOW_LATEST_GPYTORCH_LINOP: true
50+
run: |
51+
uv pip install ."[dev, tutorials]"
52+
- if: ${{ inputs.new_version }}
53+
name: Create new docusaurus version
54+
run: |
55+
python3 scripts/convert_ipynb_to_mdx.py --clean
56+
cd website
57+
yarn
58+
yarn docusaurus docs:version ${{ inputs.new_version }}
59+
60+
git add versioned_docs/ versioned_sidebars/ versions.json
61+
git commit -m "Create version ${{ inputs.new_version }} of site in Docusaurus"
62+
git push --force origin HEAD:docusaurus-versions
63+
- name: Build website
64+
run: |
65+
bash scripts/build_docs.sh -b
66+
- name: Upload website build as artifact
67+
id: deployment
68+
uses: actions/upload-pages-artifact@v3
69+
with:
70+
path: website/build/
71+
72+
deploy-website:
73+
needs: build-website
74+
permissions:
75+
pages: write
76+
id-token: write
77+
environment:
78+
name: github-pages
79+
url: ${{ steps.deployment.outputs.page_url }}
80+
runs-on: ubuntu-latest
81+
steps:
82+
- name: Deploy to GitHub Pages
83+
id: deployment
84+
uses: actions/deploy-pages@v4

.github/workflows/reusable_test.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,31 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
os: ["ubuntu-latest", "macos-14", "windows-latest"]
23-
python-version: ["3.10", "3.12"]
23+
python-version: ["3.10", "3.13"]
24+
env:
25+
# `uv pip ...` requires venv by default. This skips that requirement.
26+
UV_SYSTEM_PYTHON: 1
2427
steps:
2528
- uses: actions/checkout@v4
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v5
2631
- name: Set up Python ${{ matrix.python-version }}
2732
uses: actions/setup-python@v5
2833
with:
2934
python-version: ${{ matrix.python-version }}
3035
- name: Install (auto-install dependencies)
3136
if: ${{ !inputs.use_latest_pytorch_gpytorch }}
3237
run: |
33-
pip install .[test]
38+
uv pip install .[test]
3439
- name: Install dependencies with latest PyTorch & GPyTorch
3540
if: ${{ inputs.use_latest_pytorch_gpytorch }}
3641
env:
3742
ALLOW_LATEST_GPYTORCH_LINOP: true
3843
run: |
39-
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
40-
pip install git+https://github.com/cornellius-gp/linear_operator.git
41-
pip install git+https://github.com/cornellius-gp/gpytorch.git
42-
pip install .[test]
44+
uv pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
45+
uv pip install git+https://github.com/cornellius-gp/linear_operator.git
46+
uv pip install git+https://github.com/cornellius-gp/gpytorch.git
47+
uv pip install .[test]
4348
- name: Unit tests and coverage -- BoTorch
4449
run: |
4550
pytest -ra test/ --cov botorch/ --cov-report term-missing --cov-report xml:botorch_cov.xml

0 commit comments

Comments
 (0)