Skip to content

Commit 6ef9718

Browse files
authored
Adding uv, conda, and mamba workflow recipes (#1)
1 parent 031fb94 commit 6ef9718

File tree

2 files changed

+156
-21
lines changed

2 files changed

+156
-21
lines changed

.github/workflows/pyrosetta.yml

Lines changed: 146 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,159 @@
11
name: PyRosetta
22

33
on:
4-
push:
5-
branches: ['*']
6-
tags: ['*']
7-
pull_request:
8-
branches: ['*']
9-
schedule:
4+
push:
5+
branches: ['*']
6+
tags: ['*']
7+
pull_request:
8+
branches: ['*']
9+
schedule:
1010
# Run Every Monday 4 AM UTC
11-
- cron: '0 4 * * 1'
11+
- cron: '0 4 * * 1'
1212

1313
env:
1414
CARGO_TERM_COLOR: always
1515

1616
jobs:
17+
18+
# ============================================================
19+
# PIXI JOB
20+
# ============================================================
1721
pixi:
22+
name: Pixi
23+
runs-on: ubuntu-latest
24+
strategy:
25+
matrix:
26+
python-version: [3.13]
27+
# TODO: [3.10, 3.11, 3.12, 3.13, 3.14]
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- name: Set up Pixi
32+
uses: prefix-dev/[email protected]
33+
with:
34+
environments: py313
35+
manifest-path: pyrosetta/pixi/pixi.toml
36+
37+
- name: Run tests (pixi)
38+
run: |
39+
cd pyrosetta/pixi
40+
pixi run python -m unittest discover -s pyrosetta.tests.distributed.cluster
41+
42+
# ============================================================
43+
# UV JOB
44+
# ============================================================
45+
uv:
46+
name: uv
1847
runs-on: ubuntu-latest
1948
strategy:
20-
matrix:
21-
#environment: [py310, py311, py312, py313, py314, ]
22-
environment: [py313, ]
49+
matrix:
50+
python-version: [3.13]
51+
# TODO: [3.10, 3.11, 3.12, 3.13, 3.14]
2352
steps:
24-
- uses: actions/checkout@v4
25-
- uses: prefix-dev/[email protected]
26-
with:
27-
environments: ${{ matrix.environment }}
28-
manifest-path: pyrosetta/pixi/pixi.toml
29-
30-
- name: distributed.cluster
31-
run: |
32-
#cd pyrosetta/pixi && pixi run -e ${{ matrix.environment }} test
33-
# cd pyrosetta/pixi && pixi run python -m unittest pyrosetta.tests.*
34-
cd pyrosetta/pixi && pixi run python -m unittest discover -s pyrosetta.tests.distributed.cluster
53+
- uses: actions/checkout@v4
54+
55+
- name: Set up Python
56+
uses: actions/setup-python@v4
57+
with:
58+
python-version: ${{ matrix.python-version }}
59+
60+
- name: Install uv
61+
run: |
62+
curl -LsSf https://astral.sh/uv/install.sh | sh
63+
echo "$HOME/.local/bin" >> $GITHUB_PATH
64+
uv --version
65+
66+
- name: Install PyRosetta dependencies
67+
run: |
68+
uv pip install --system pyrosetta-installer
69+
70+
- name: Install PyRosetta via installer
71+
run: |
72+
python - <<'EOF'
73+
import pyrosetta_installer
74+
try:
75+
pyrosetta_installer.install_pyrosetta(
76+
distributed=True,
77+
serialization=True,
78+
skip_if_installed=True,
79+
mirror=0
80+
)
81+
except Exception as e:
82+
print(f"PyRosetta installation with 'mirror=0' failed: {e}. Retrying with 'mirror=1'.")
83+
pyrosetta_installer.install_pyrosetta(
84+
distributed=True,
85+
serialization=True,
86+
skip_if_installed=True,
87+
mirror=1
88+
)
89+
EOF
90+
91+
- name: Run tests (uv)
92+
run: |
93+
python -m unittest discover -s pyrosetta.tests.distributed.cluster
94+
95+
# ============================================================
96+
# CONDA JOB
97+
# ============================================================
98+
conda:
99+
name: Conda
100+
runs-on: ubuntu-latest
101+
strategy:
102+
matrix:
103+
python-version: [3.13]
104+
# TODO: [3.10, 3.11, 3.12, 3.13, 3.14]
105+
steps:
106+
- uses: actions/checkout@v4
107+
108+
- name: Set up Conda
109+
uses: conda-incubator/setup-miniconda@v3
110+
with:
111+
python-version: ${{ matrix.python-version }}
112+
auto-update-conda: true
113+
activate-environment: pyrosetta-env
114+
environment-file: pyrosetta/conda/environment.yml
115+
channel-priority: strict
116+
117+
- name: Run tests (conda)
118+
shell: bash -l {0}
119+
run: |
120+
# Initialize conda for the current shell
121+
eval "$(conda shell.bash hook)"
122+
# Activate the environment
123+
conda activate pyrosetta-env
124+
# Run unittest
125+
python -m unittest discover -s pyrosetta.tests.distributed.cluster
126+
127+
# ============================================================
128+
# MAMBA JOB
129+
# ============================================================
130+
mamba:
131+
name: Mamba
132+
runs-on: ubuntu-latest
133+
strategy:
134+
matrix:
135+
python-version: [3.13]
136+
# TODO: [3.10, 3.11, 3.12, 3.13, 3.14]
137+
steps:
138+
- uses: actions/checkout@v4
139+
140+
- name: Set up Miniconda
141+
uses: conda-incubator/setup-miniconda@v3
142+
with:
143+
python-version: ${{ matrix.python-version }}
144+
auto-update-conda: true
145+
146+
- name: Set up Mamba
147+
run: |
148+
conda install -n base -c conda-forge mamba
149+
mamba env create -f pyrosetta/conda/environment.yml
150+
151+
- name: Run tests (mamba)
152+
shell: bash -l {0}
153+
run: |
154+
# Initialize conda for the current shell
155+
eval "$(conda shell.bash hook)"
156+
# Activate the environment
157+
conda activate pyrosetta-env
158+
# Run unittest
159+
python -m unittest discover -s pyrosetta.tests.distributed.cluster

pyrosetta/conda/environment.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: pyrosetta-env
2+
channels:
3+
- https://conda.rosettacommons.org
4+
- conda-forge
5+
dependencies:
6+
- python>=3.10,<3.15
7+
- pyrosetta
8+
- pip
9+
- pip:
10+
- pyrosetta-distributed

0 commit comments

Comments
 (0)