Skip to content

Commit 138dc15

Browse files
Balandatfacebook-github-bot
authored andcommitted
Fix test_stable GHA workflow (#1492)
Summary: We do some grepping magic to extract the versions from `botorch.egg-info/requires.txt` after running `python setup.py egg_info`. This was not properly working when pinning a version to an exact match. This fixes that by allowing both `>=` and `==` version specification in the grep rexexp. Pull Request resolved: #1492 Reviewed By: saitcakmak Differential Revision: D41190556 Pulled By: Balandat fbshipit-source-id: b2b6171cab796ae260cd49b1da6ac7b6645baf7a
1 parent 1484c89 commit 138dc15

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

.github/workflows/reusable_tutorials.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ jobs:
3636
pip install git+https://github.com/cornellius-gp/linear_operator.git
3737
pip install git+https://github.com/cornellius-gp/gpytorch.git
3838
- if: ${{ inputs.use_stable_pytorch_gpytorch }}
39-
name: Install min required PyTorch & GPyTorch
39+
name: Install min required PyTorch, GPyTorch, and linear_operator
4040
run: |
4141
python setup.py egg_info
4242
req_txt="botorch.egg-info/requires.txt"
43-
min_torch_version=$(grep '\btorch>=' ${req_txt} | sed 's/[^0-9.]//g')
44-
min_gpytorch_version=$(grep '\bgpytorch>=' ${req_txt} | sed 's/[^0-9.]//g')
45-
pip install "torch==${min_torch_version}" "gpytorch==${min_gpytorch_version}" torchvision
43+
min_torch_version=$(grep '\btorch[>=]=' ${req_txt} | sed 's/[^0-9.]//g')
44+
min_gpytorch_version=$(grep '\bgpytorch[>=]=' ${req_txt} | sed 's/[^0-9.]//g')
45+
min_linear_operator_version=$(grep '\blinear_operator[>=]=' ${req_txt} | sed 's/[^0-9.]//g')
46+
pip install "torch==${min_torch_version}" "gpytorch==${min_gpytorch_version}" "linear_operator==${min_linear_operator_version}" torchvision
4647
- name: Install BoTorch with tutorials dependencies
4748
env:
4849
ALLOW_LATEST_GPYTORCH_LINOP: true

.github/workflows/test_stable.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
pytest -ra
5757
5858
tests-and-coverage-min-req-pip:
59-
name: Tests and coverage min req. torch & gpytorch versions (pip, Python ${{ matrix.python-version }}, ${{ matrix.os }})
59+
name: Tests and coverage min req. torch, gpytorch & linear_operator versions (pip, Python ${{ matrix.python-version }}, ${{ matrix.os }})
6060
runs-on: ${{ matrix.os }}
6161
strategy:
6262
fail-fast: false
@@ -73,9 +73,10 @@ jobs:
7373
run: |
7474
python setup.py egg_info
7575
req_txt="botorch.egg-info/requires.txt"
76-
min_torch_version=$(grep '\btorch>=' ${req_txt} | sed 's/[^0-9.]//g')
77-
min_gpytorch_version=$(grep '\bgpytorch>=' ${req_txt} | sed 's/[^0-9.]//g')
78-
pip install "torch==${min_torch_version}" "gpytorch==${min_gpytorch_version}"
76+
min_torch_version=$(grep '\btorch[>=]=' ${req_txt} | sed 's/[^0-9.]//g')
77+
min_gpytorch_version=$(grep '\bgpytorch[>=]=' ${req_txt} | sed 's/[^0-9.]//g')
78+
min_linear_operator_version=$(grep '\blinear_operator[>=]=' ${req_txt} | sed 's/[^0-9.]//g')
79+
pip install "torch==${min_torch_version}" "gpytorch==${min_gpytorch_version}" "linear_operator==${min_linear_operator_version}"
7980
pip install .[test]
8081
- name: Unit tests and coverage
8182
run: |

0 commit comments

Comments
 (0)