Skip to content

Add uv project, and run TestEnvironmentReproducibility tests #18

Add uv project, and run TestEnvironmentReproducibility tests

Add uv project, and run TestEnvironmentReproducibility tests #18

Workflow file for this run

name: PyRosetta
on:
push:
branches: ['*']
tags: ['*']
pull_request:
branches: ['*']
schedule:
# Run Every Monday 4 AM UTC
- cron: '0 4 * * 1'
env:
CARGO_TERM_COLOR: always
jobs:
# ============================================================
# PIXI JOB
# ============================================================
pixi:
name: Pixi
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.13]
# TODO: [3.10, 3.11, 3.12, 3.13, 3.14]
steps:
- uses: actions/checkout@v4
- name: Set up Pixi
uses: prefix-dev/[email protected]
with:
environments: py313
manifest-path: pyrosetta/pixi/pixi.toml
- name: Run tests (pixi)
run: |
cd pyrosetta/pixi
pixi run python -u -m unittest pyrosetta.tests.distributed.cluster.test_reproducibility.TestEnvironmentReproducibility.test_recreate_environment_pixi -v
# ============================================================
# UV JOB
# ============================================================
uv:
name: Uv
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.13]
# TODO: [3.10, 3.11, 3.12, 3.13, 3.14]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
uv --version
- name: Create new uv project
run: |
export PATH="$HOME/.local/bin:$PATH"
uv init pyrosetta_uv_project
- name: Install PyRosetta dependencies
run: |
export PATH="$HOME/.local/bin:$PATH"
cd pyrosetta_uv_project
uv pip install pyrosetta-installer
- name: Install PyRosetta via installer in uv project
run: |
export PATH="$HOME/.local/bin:$PATH"
python - <<'EOF'
import pyrosetta_installer
try:
pyrosetta_installer.install_pyrosetta(
distributed=True,
serialization=True,
skip_if_installed=True,
mirror=0
)
except Exception as e:
print(f"PyRosetta installation with 'mirror=0' failed: {e}. Retrying with 'mirror=1'.")
pyrosetta_installer.install_pyrosetta(
distributed=True,
serialization=True,
skip_if_installed=True,
mirror=1
)
EOF
- name: Run tests (uv)
run: |
export PATH="$HOME/.local/bin:$PATH"
uv run -p pyrosetta_uv_project python -u -m unittest pyrosetta.tests.distributed.cluster.test_reproducibility.TestEnvironmentReproducibility.test_recreate_environment_uv -v
# ============================================================
# CONDA JOB
# ============================================================
conda:
name: Conda
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.13]
# TODO: [3.10, 3.11, 3.12, 3.13, 3.14]
steps:
- uses: actions/checkout@v4
- name: Set up Conda
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
auto-update-conda: true
activate-environment: pyrosetta-env
environment-file: pyrosetta/conda/environment.yml
channel-priority: strict
- name: Run tests (conda)
shell: bash -l {0}
run: |
# Initialize conda for the current shell
eval "$(conda shell.bash hook)"
# Activate the environment
conda activate pyrosetta-env
# Run unittest
python -u -m unittest pyrosetta.tests.distributed.cluster.test_reproducibility.TestEnvironmentReproducibility.test_recreate_environment_conda -v
# ============================================================
# MAMBA JOB
# ============================================================
mamba:
name: Mamba
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.13]
# TODO: [3.10, 3.11, 3.12, 3.13, 3.14]
steps:
- uses: actions/checkout@v4
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
auto-update-conda: true
- name: Set up Mamba
run: |
conda install -n base -c conda-forge mamba
mamba env create -f pyrosetta/conda/environment.yml
- name: Run tests (mamba)
shell: bash -l {0}
run: |
# Initialize conda for the current shell
eval "$(conda shell.bash hook)"
# Activate the environment
conda activate pyrosetta-env
# Run unittest
python -u -m unittest pyrosetta.tests.distributed.cluster.test_reproducibility.TestEnvironmentReproducibility.test_recreate_environment_mamba -v