Skip to content

Commit 42c359b

Browse files
committed
Readd Colab dev setup
1 parent a9eb6c8 commit 42c359b

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

Contributing.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,44 @@ pytest tests
5555
* git commit and push as usual
5656
* `git tag v2.1.1234 -m v2.1.1234`, make sure it's the correct number (if you don't have permission, ask one of the team to push the tag)
5757
* `git push --tags`
58-
* In colabfold: update the number of `alphafold-colabfold = { version = "` in pyproject.toml, commit and push
58+
* In colabfold: update the number of `alphafold-colabfold = { version = "` in pyproject.toml, commit and push
59+
60+
# Colab dev setup
61+
62+
While it's generally easier to edit locally, you can also test and develop directly in google colab.
63+
64+
We clone to _directory to avoid python from importing from the directory.
65+
66+
```
67+
%%bash
68+
69+
pip install -U pip
70+
git clone https://github.com/sokrypton/Colabfold _colabfold
71+
pip install _colabfold
72+
# Unholy Hack: Use the files from our cloned git repository instead of installed copy
73+
site_packages=$(python -c 'import site; print(site.getsitepackages()[0])')
74+
rm -r ${site_packages}/colabfold
75+
ln -s $(pwd)/_colabfold/colabfold ${site_packages}/colabfold
76+
```
77+
78+
If you also need to patch alphafold:
79+
80+
```
81+
%%bash
82+
83+
pip uninstall -y alphafold
84+
git clone https://github.com/sokrypton/alphafold _alphafold
85+
pip install -e ./_alphafold
86+
```
87+
88+
After that, restart the runtime.
89+
90+
When you changed a file in the `colabfold` package, you need to reload the modules you were using with `importlib.reload()`, e.g.
91+
92+
```python
93+
import colabfold.batch
94+
import importlib
95+
96+
importlib.reload(colabfold.batch)
97+
```
98+

0 commit comments

Comments
 (0)