Applying linting to notebooks #1287
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
testing_minimal: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.9', '3.10', '3.11' ] | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up uv | |
uses: astral-sh/setup-uv@v2 | |
with: | |
enable-cache: true | |
- name: Minimal Bofire, Python ${{ matrix.python-version }} | |
run: uv pip install "." pytest --system | |
- name: Run domain-only test, Python ${{ matrix.python-version }} | |
run: pytest tests/bofire/data_models | |
testing: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ '3.9', '3.11' ] | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v4 | |
- name: Setup Conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniconda-version: "latest" | |
activate-environment: test | |
auto-activate-base: false # Prevent automatic activation of the base environment | |
python-version: ${{ matrix.python-version }} | |
# Run `conda init` to initialize shell for conda | |
- name: Initialize Conda | |
shell: bash -l {0} | |
run: | | |
conda init bash | |
source ~/.bashrc # Reload shell configuration after running `conda init` | |
conda activate test | |
- name: Install conda-only dependencies, Python ${{ matrix.python-version }} | |
shell: bash -l {0} | |
run: | | |
conda install -c conda-forge cyipopt | |
- name: Set up uv | |
uses: astral-sh/setup-uv@v2 | |
with: | |
enable-cache: true | |
- name: Install remaining dependencies, Python ${{ matrix.python-version }} | |
run: | | |
uv pip install -e ".[optimization,tests,cheminfo,xgb,entmoot]" --system | |
- name: Run tests, Python ${{ matrix.python-version }} | |
shell: bash -l {0} | |
run: | | |
pytest -ra --cov=bofire --cov-report term-missing tests | |
testing_against_latest_botorch: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v4 | |
- name: Setup Conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniconda-version: "latest" | |
activate-environment: test | |
auto-activate-base: false # Prevent automatic activation of the base environment | |
python-version: "3.10" | |
# Run `conda init` to initialize shell for conda | |
- name: Initialize Conda | |
shell: bash -l {0} | |
run: | | |
conda init bash | |
source ~/.bashrc # Reload shell configuration after running `conda init` | |
conda activate test | |
- name: Install conda-only dependencies | |
shell: bash -l {0} | |
run: | | |
conda install -c conda-forge cyipopt | |
- name: Set up uv | |
uses: astral-sh/setup-uv@v2 | |
with: | |
enable-cache: true | |
- name: Install remaining dependencies | |
run: | | |
uv pip install --upgrade git+https://github.com/cornellius-gp/linear_operator.git --system | |
uv pip install --upgrade git+https://github.com/cornellius-gp/gpytorch.git --system | |
export ALLOW_LATEST_GPYTORCH_LINOP=true | |
uv pip install --upgrade git+https://github.com/pytorch/botorch.git --system | |
uv pip install ".[optimization,tests,cheminfo,xgb,entmoot]" --system | |
- name: Run tests, Python ${{ matrix.python-version }} | |
shell: bash -l {0} | |
run: | | |
pytest -ra --cov=bofire --cov-report term-missing tests | |
testing_tutorials: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v4 | |
- name: Setup Conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniconda-version: "latest" | |
activate-environment: test | |
auto-activate-base: false # Prevent automatic activation of the base environment | |
python-version: "3.10" | |
# Run `conda init` to initialize shell for conda | |
- name: Initialize Conda | |
shell: bash -l {0} | |
run: | | |
conda init bash | |
source ~/.bashrc # Reload shell configuration after running `conda init` | |
conda activate test | |
- name: Install conda-only dependencies | |
shell: bash -l {0} | |
run: | | |
conda install -c conda-forge cyipopt | |
- name: Set up uv | |
uses: astral-sh/setup-uv@v2 | |
with: | |
enable-cache: true | |
- name: Install remaining dependencies | |
run: | | |
uv pip install ".[optimization,tests,cheminfo,xgb,entmoot,tutorials]" --system | |
- name: Run notebooks | |
shell: bash -l {0} | |
run: | | |
python scripts/run_tutorials.py -p "$(pwd)" |