Skip to content

Commit 404d869

Browse files
sdaultonfacebook-github-bot
authored andcommitted
bump to minimum python version to 3.10 and test 3.12 (#2293)
Summary: ## Motivation Bump minimum version of python from 3.9 -> 3.10 and start testing 3.12, since scientific python is no longer supporting py3.9: https://scientific-python.org/specs/spec-0000/ ### Have you read the [Contributing Guidelines on pull requests](https://github.com/pytorch/botorch/blob/main/CONTRIBUTING.md#pull-requests)? (Write your answer here.) Pull Request resolved: #2293 Test Plan: Circle CI, running manual nightly job: https://github.com/sdaulton/botorch/actions/runs/8638469226 Reviewed By: saitcakmak Differential Revision: D55991521 Pulled By: sdaulton fbshipit-source-id: b89054c8a74848b3193d890adc7a35d090e623a0
1 parent e8cbbae commit 404d869

13 files changed

+26
-50
lines changed

.conda/meta.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ build:
1313

1414
requirements:
1515
host:
16-
- python>=3.9
16+
- python>=3.10
1717
- setuptools
1818
- setuptools_scm
1919
run:

.github/workflows/deploy_on_release.yml

+4-7
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
os: ["ubuntu-latest", "macos-14", "windows-latest"]
18-
python-version: ["3.9", "3.11"]
19-
exclude:
20-
- os: "macos-14"
21-
python-version: "3.9" # not available for macos-14
18+
python-version: ["3.10", "3.12"]
2219
steps:
2320
- uses: actions/checkout@v4
2421
- name: Set up Python ${{ matrix.python-version }}
@@ -32,7 +29,7 @@ jobs:
3229
run: |
3330
pytest -ra --cov=. --cov-report term-missing
3431
- name: Upload coverage
35-
if: ${{ runner.os == 'Linux' && matrix.python-version == 3.9 }}
32+
if: ${{ runner.os == 'Linux' && matrix.python-version == 3.10 }}
3633
run: |
3734
bash <(curl -s https://codecov.io/bash)
3835
@@ -49,7 +46,7 @@ jobs:
4946
- name: Set up Python
5047
uses: actions/setup-python@v5
5148
with:
52-
python-version: "3.9"
49+
python-version: "3.10"
5350
- name: Install dependencies
5451
run: |
5552
pip install .[test]
@@ -79,7 +76,7 @@ jobs:
7976
with:
8077
miniconda-version: "latest"
8178
activate-environment: test
82-
python-version: "3.9"
79+
python-version: "3.10"
8380
- name: Fetch all history for all tags and branches
8481
run: git fetch --prune --unshallow
8582
- name: Install dependencies

.github/workflows/docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Set up Python
2121
uses: actions/setup-python@v5
2222
with:
23-
python-version: "3.9"
23+
python-version: "3.10"
2424
- name: Install dependencies
2525
env:
2626
ALLOW_LATEST_GPYTORCH_LINOP: true

.github/workflows/lint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Set up Python
2121
uses: actions/setup-python@v5
2222
with:
23-
python-version: "3.9"
23+
python-version: "3.10"
2424
- name: Install dependencies
2525
run: |
2626
# pin dependencies to match Meta-internal versions
@@ -40,7 +40,7 @@ jobs:
4040
- name: Set up Python
4141
uses: actions/setup-python@v5
4242
with:
43-
python-version: "3.9"
43+
python-version: "3.10"
4444
- name: Install dependencies
4545
run: |
4646
pip install flake8 flake8-docstrings

.github/workflows/nightly.yml

+4-7
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
os: ["ubuntu-latest", "macos-14", "windows-latest"]
18-
python-version: ["3.9", "3.11"]
19-
exclude:
20-
- os: "macos-14"
21-
python-version: "3.9" # not available for macos-14
18+
python-version: ["3.10", "3.12"]
2219
steps:
2320
- uses: actions/checkout@v4
2421
- name: Set up Python ${{ matrix.python-version }}
@@ -37,7 +34,7 @@ jobs:
3734
run: |
3835
pytest -ra --cov=. --cov-report term-missing
3936
- name: Upload coverage
40-
if: ${{ runner.os == 'Linux' && matrix.python-version == 3.9 }}
37+
if: ${{ runner.os == 'Linux' && matrix.python-version == 3.10 }}
4138
run: |
4239
bash <(curl -s https://codecov.io/bash)
4340
@@ -53,7 +50,7 @@ jobs:
5350
- name: Set up Python
5451
uses: actions/setup-python@v5
5552
with:
56-
python-version: 3.9
53+
python-version: 3.10
5754
- name: Install dependencies
5855
env:
5956
ALLOW_LATEST_GPYTORCH_LINOP: true
@@ -99,7 +96,7 @@ jobs:
9996
with:
10097
miniconda-version: "latest"
10198
activate-environment: test
102-
python-version: "3.9"
99+
python-version: "3.10"
103100
- name: Fetch all history for all tags and branches
104101
run: git fetch --prune --unshallow
105102
- name: Install dependencies

.github/workflows/reusable_tutorials.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ jobs:
4343
- name: Set up Python
4444
uses: actions/setup-python@v5
4545
with:
46-
python-version: "3.9"
46+
python-version: "3.10"
4747
- name: Fetch all history for all tags and branches
4848
# We need to do this so setuptools_scm knows how to set the BoTorch version.
4949
run: git fetch --prune --unshallow
5050
- if: ${{ !inputs.use_stable_pytorch_gpytorch }}
5151
name: Install latest PyTorch & GPyTorch
5252
run: |
53-
pip install --pre torch torchvision -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
53+
pip install torch torchvision -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
5454
pip install git+https://github.com/cornellius-gp/linear_operator.git
5555
pip install git+https://github.com/cornellius-gp/gpytorch.git
5656
- if: ${{ inputs.use_stable_pytorch_gpytorch }}

.github/workflows/reusable_website.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Set up Python
3030
uses: actions/setup-python@v5
3131
with:
32-
python-version: 3.9
32+
python-version: 3.10
3333
- name: Fetch all history for all tags and branches
3434
run: git fetch --prune --unshallow
3535
- if: ${{ !inputs.publish_versioned_website }}

.github/workflows/test.yml

+3-9
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
os: ["ubuntu-latest", "macos-14", "windows-latest"]
19-
python-version: ["3.9", "3.11"]
20-
exclude:
21-
- os: "macos-14"
22-
python-version: "3.9" # not available for macos-14
19+
python-version: ["3.10", "3.12"]
2320
steps:
2421
- uses: actions/checkout@v4
2522
- name: Set up Python ${{ matrix.python-version }}
@@ -38,7 +35,7 @@ jobs:
3835
run: |
3936
pytest -ra --cov=. --cov-report term-missing
4037
- name: Upload coverage
41-
if: ${{ runner.os == 'Linux' && matrix.python-version == 3.9 }}
38+
if: ${{ runner.os == 'Linux' && matrix.python-version == 3.10 }}
4239
run: |
4340
bash <(curl -s https://codecov.io/bash)
4441
@@ -49,10 +46,7 @@ jobs:
4946
fail-fast: false
5047
matrix:
5148
os: ["ubuntu-latest", "macos-14", "windows-latest"]
52-
python-version: ["3.9", "3.11"]
53-
exclude:
54-
- os: "macos-14"
55-
python-version: "3.9" # not available for macos-14
49+
python-version: ["3.10", "3.12"]
5650
steps:
5751
- uses: actions/checkout@v4
5852
- uses: conda-incubator/setup-miniconda@v3

.github/workflows/test_stable.yml

+3-12
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
os: ["ubuntu-latest", "macos-14", "windows-latest"]
15-
python-version: ["3.9", "3.11"]
16-
exclude:
17-
- os: "macos-14"
18-
python-version: "3.9" # not available for macos-14
15+
python-version: ["3.10", "3.12"]
1916
steps:
2017
- uses: actions/checkout@v4
2118
- name: Set up Python ${{ matrix.python-version }}
@@ -37,10 +34,7 @@ jobs:
3734
fail-fast: false
3835
matrix:
3936
os: ["ubuntu-latest", "macos-14", "windows-latest"]
40-
python-version: ["3.9", "3.11"]
41-
exclude:
42-
- os: "macos-14"
43-
python-version: "3.9" # not available for macos-14
37+
python-version: ["3.10", "3.12"]
4438
steps:
4539
- uses: actions/checkout@v4
4640
- uses: conda-incubator/setup-miniconda@v3
@@ -70,10 +64,7 @@ jobs:
7064
fail-fast: false
7165
matrix:
7266
os: ["ubuntu-latest", "macos-14"]
73-
python-version: ["3.9", "3.11"]
74-
exclude:
75-
- os: "macos-14"
76-
python-version: "3.9" # not available for macos-14
67+
python-version: ["3.10", "3.12"]
7768
steps:
7869
- uses: actions/checkout@v4
7970
- name: Set up Python ${{ matrix.python-version }}

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ every `__init__` function contains an `Args:` block. We use the
5050

5151
#### Type Hints
5252

53-
BoTorch is fully typed using python 3.9+
53+
BoTorch is fully typed using python 3.10+
5454
[type hints](https://www.python.org/dev/peps/pep-0484/). We expect any
5555
contributions to also use proper type annotations. While we currently do not
5656
enforce full consistency of these in our continuous integration test, you should

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Optimization simply use Ax.
5555
## Installation
5656

5757
**Installation Requirements**
58-
- Python >= 3.9
58+
- Python >= 3.10
5959
- PyTorch >= 1.13.1
6060
- gpytorch == 1.11
6161
- linear_operator == 0.5.1

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
# Minimum required python version
1313
REQUIRED_MAJOR = 3
14-
REQUIRED_MINOR = 9
14+
REQUIRED_MINOR = 10
1515

1616
# Requirements for testing, formatting, and tutorials
1717
TEST_REQUIRES = ["pytest", "pytest-cov"]
@@ -98,7 +98,7 @@ def read_deps_from_file(filname):
9898
],
9999
long_description=long_description,
100100
long_description_content_type="text/markdown",
101-
python_requires=">=3.9",
101+
python_requires=f">={REQUIRED_MAJOR}.{REQUIRED_MINOR}",
102102
packages=find_packages(exclude=["test", "test.*"]),
103103
install_requires=install_requires,
104104
extras_require={

test/acquisition/test_decoupled.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ def forward(self, X):
2222

2323
class TestDecoupledAcquisitionFunction(BotorchTestCase):
2424
def test_decoupled_acquisition_function(self):
25-
msg = (
26-
"Can't instantiate abstract class DecoupledAcquisitionFunction"
27-
" with abstract method forward"
28-
)
25+
msg = "Can't instantiate abstract class DecoupledAcquisitionFunction"
2926
with self.assertRaisesRegex(TypeError, msg):
3027
DecoupledAcquisitionFunction()
3128
# test raises error if model is not ModelList

0 commit comments

Comments
 (0)