From 6140bdb4bc0879d7ab5688f12da28fd992eb0d0f Mon Sep 17 00:00:00 2001 From: Rhys Goodall Date: Tue, 8 Oct 2024 15:50:06 -0400 Subject: [PATCH] mamba? --- .github/workflows/test.yaml | 101 ++++++++++++------------------------ 1 file changed, 33 insertions(+), 68 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e7d27568e..fa9cf9b08 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -42,39 +42,29 @@ jobs: - 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 }} + - name: Set up micromamba + uses: mamba-org/setup-micromamba@main - # Run `conda init` to initialize shell for conda - - name: Initialize Conda - shell: bash -l {0} + - name: Create mamba environment run: | - conda init bash - source ~/.bashrc # Reload shell configuration after running `conda init` - conda activate test + micromamba create -n test python=${{ matrix.python-version }} --yes + + - name: Install uv + run: micromamba run -n test pip install uv - 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 + micromamba install -n test -c conda-forge cyipopt --yes - name: Install remaining dependencies, Python ${{ matrix.python-version }} run: | - uv pip install -e ".[optimization,tests,cheminfo,xgb,entmoot]" --system + micromamba run -n test uv pip install -e ".[optimization,tests,cheminfo,xgb,entmoot]" --system - name: Run tests, Python ${{ matrix.python-version }} shell: bash -l {0} run: | + micromamba activate test pytest -ra --cov=bofire --cov-report term-missing tests testing_against_latest_botorch: @@ -86,46 +76,33 @@ jobs: - 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 }} + - name: Set up micromamba + uses: mamba-org/setup-micromamba@main - # Run `conda init` to initialize shell for conda - - name: Initialize Conda - shell: bash -l {0} + - name: Create mamba environment run: | - conda init bash - source ~/.bashrc # Reload shell configuration after running `conda init` - conda activate test + micromamba create -n test python=${{ matrix.python-version }} --yes + + - name: Install uv + run: micromamba run -n test pip install uv - name: Install conda-only dependencies, Python ${{ matrix.python-version }} shell: bash -l {0} run: | - conda activate test - conda install -c conda-forge cyipopt - - - name: Set up uv - uses: astral-sh/setup-uv@v2 - with: - enable-cache: true + micromamba install -n test -c conda-forge cyipopt --yes - name: Install remaining dependencies, Python ${{ matrix.python-version }} run: | - conda activate test - 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 + micromamba run -n test uv pip install --upgrade git+https://github.com/cornellius-gp/linear_operator.git --system + micromamba run -n test 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 + micromamba run -n test uv pip install --upgrade git+https://github.com/pytorch/botorch.git --system + micromamba run -n test uv pip install ".[optimization,tests,cheminfo,xgb,entmoot]" --system - name: Run tests, Python ${{ matrix.python-version }} shell: bash -l {0} run: | - conda activate test + micromamba activate test pytest -ra --cov=bofire --cov-report term-missing tests testing_tutorials: @@ -137,39 +114,27 @@ jobs: - 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 }} + - name: Set up micromamba + uses: mamba-org/setup-micromamba@main - # Run `conda init` to initialize shell for conda - - name: Initialize Conda - shell: bash -l {0} + - name: Create mamba environment run: | - conda init bash - source ~/.bashrc # Reload shell configuration after running `conda init` + micromamba create -n test python=${{ matrix.python-version }} --yes + + - name: Install uv + run: micromamba run -n test pip install uv - name: Install conda-only dependencies, Python ${{ matrix.python-version }} shell: bash -l {0} run: | - conda activate test - conda install -c conda-forge cyipopt - - - name: Set up uv - uses: astral-sh/setup-uv@v2 - with: - enable-cache: true + micromamba install -n test -c conda-forge cyipopt --yes - name: Install remaining dependencies, Python ${{ matrix.python-version }} run: | - conda activate test - uv pip install ".[optimization,tests,cheminfo,xgb,entmoot,tutorials]" --system + micromamba run -n test uv pip install ".[optimization,tests,cheminfo,xgb,entmoot,tutorials]" --system - name: Run notebooks, Python ${{ matrix.python-version }} shell: bash -l {0} run: | - conda activate test + micromamba activate test python scripts/run_tutorials.py -p "$(pwd)"