-
Notifications
You must be signed in to change notification settings - Fork 53
add development instructions #988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 12 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
679017d
add `DEVELOPMENT.md`
rvhonorato 661bfad
Merge branch 'main' into dev-docs
amjjbonvin 2e49f69
Update DEVELOPMENT.md
amjjbonvin 3d28983
Update DEVELOPMENT.md
amjjbonvin 02fcdbe
Update DEVELOPMENT.md
amjjbonvin 1ccd6b1
Update DEVELOPMENT.md
amjjbonvin 13ef1c4
Update DEVELOPMENT.md
amjjbonvin 3209c6c
Update DEVELOPMENT.md
amjjbonvin af86ae1
Update DEVELOPMENT.md
amjjbonvin c3d55ae
tweaks
rvhonorato 3668525
Update DEVELOPMENT.md
amjjbonvin 2627b13
Update DEVELOPMENT.md
amjjbonvin f7b8ea5
Update DEVELOPMENT.md
amjjbonvin 6a1eb76
Merge branch 'main' into dev-docs
rvhonorato 4530979
add system-dependencies
rvhonorato 645b4fa
update text
rvhonorato 0d779b4
update ci.yml
rvhonorato 83aeb32
use specific python3.9 path
rvhonorato e5c8cca
add CustomDevelop wrapper
rvhonorato 7ce504e
update ci.yml
rvhonorato bb08c78
update development instructions
rvhonorato 245b1bb
update `docs.yml`
rvhonorato 315b359
update actions
rvhonorato 4c6ecd8
remove artifact
rvhonorato 40fad57
tweak
rvhonorato fc17537
Removed full path to python3.9
amjjbonvin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,136 @@ | ||
| # Developing HADDOCK3 | ||
|
|
||
| This file provides information on how to setup a development environment for HADDOCK3. | ||
|
|
||
| - [System requirements](#system-requirements) | ||
| - [Python3.9](#python39) | ||
| - [git](#git) | ||
| - [gcc](#gcc) | ||
| - [OpenMPI](#openmpi) | ||
| - [Setting up the development environment](#setting-up-the-development-environment) | ||
| - [Clone the repository](#clone-the-repository) | ||
| - [Python environment](#python-environment) | ||
| - [Install Python dependencies](#install-python-dependencies) | ||
| - [Running tests](#running-tests) | ||
|
|
||
| ## System requirements | ||
|
|
||
| - Python 3.9 | ||
| - CNS | ||
| - git | ||
| - gcc | ||
| - OpenMPI | ||
|
|
||
| ### Installing system dependencies | ||
|
|
||
| Below the instructions are provided for a Ubuntu system using `apt-get`. If you are using a different system, please refer to the respective package manager - `yum`, `dnf`, `pacman`, `homebrew`, `port`, etc. | ||
|
|
||
| #### Python3.9 | ||
|
|
||
| **Conda is NOT recommended for development. Instead, install and compile Python 3.9 from source.** | ||
|
|
||
| On a **Linux-based system** you can install Python 3.9 if needed with the following commands: | ||
|
|
||
| ```bash | ||
| wget https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz | ||
| tar -xf Python-3.9.6.tgz | ||
| cd Python-3.9.6 | ||
| ./configure --enable-optimizations | ||
| sudo make altinstall -j 8 | ||
| ``` | ||
|
|
||
| Then `python3.9` should be available on your system at `/usr/local/bin/python3.9` | ||
|
|
||
| On **OSX**, use rather [brew](https://brew.sh) to install Python 3.9: | ||
|
|
||
| ```bash | ||
| brew install [email protected] | ||
| ``` | ||
|
|
||
| Then `python3.9` should be available on your system at `/opt/homebrew/bin/python3.9` | ||
|
|
||
| #### Git | ||
|
|
||
| On a **Linux-based** system: | ||
|
|
||
| ```bash | ||
| sudo apt-get install git | ||
| ``` | ||
|
|
||
| #### gcc | ||
|
|
||
| On a **Linux-based** system: | ||
|
|
||
| ```bash | ||
| sudo apt-get install gcc | ||
| ``` | ||
|
|
||
| #### OpenMPI | ||
|
|
||
| On a **Linux-based** system: | ||
|
|
||
| ```bash | ||
| sudo apt-get install openmpi-bin libopenmpi3 libopenmpi-dev | ||
| ``` | ||
|
|
||
| **Note** that this step is not required on OSX. | ||
|
|
||
| ## Setting up the development environment | ||
|
|
||
| ### Clone the repository | ||
|
|
||
| ```bash | ||
| git clone --recursive https://github.com/haddocking/haddock3.git | ||
| cd haddock3 | ||
| ``` | ||
|
|
||
| ### Python environment | ||
|
|
||
| We recomend you use Python's native virtual environment to manage the dependencies. | ||
|
|
||
| ```bash | ||
| python3.9 -m venv .venv | ||
| source .venv/bin/activate | ||
| ``` | ||
|
|
||
| ### Install Python dependencies | ||
|
|
||
| Install both project dependencies and test dependencies using pip. | ||
|
|
||
| ```bash | ||
| pip install -r requirements.txt && | ||
| pip install \ | ||
| coverage==7.2.5 \ | ||
| pytest==7.3.1 \ | ||
| pytest-cov==4.0.0 \ | ||
| hypothesis==6.75.1 \ | ||
| pytest-mock==3.12.0 \ | ||
| fastapi==0.110.1 \ | ||
| httpx==0.27.0 \ | ||
| mpi4py==3.1.6 | ||
| ``` | ||
|
|
||
| **Note**: On OSX, if the installation of mpi4py fails, use instead `brew install mpi4py` | ||
amjjbonvin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| Install haddock3 in development mode. | ||
|
|
||
| ```bash | ||
| python setup.py develop | ||
| ``` | ||
|
|
||
| ## Installation in an HPC environment | ||
|
|
||
| **Please get in contact with the system administrator before doing development in a shared HPC environment.** | ||
|
|
||
| For installation in an HPC environment we recommend to check the installed Python versions on the system and also importantly if an `openmpi` (or other custom MPI) installation is available on the system. | ||
| Those are often offered via the `module` command. | ||
| If you only intend to develop haddock3 using the multiprocessing scheduler, the above instructions should be fine. But to harvest the MPI capabilities of an HPC system it is best to build haddock3 using the installed MPI version on the HPC system. | ||
|
|
||
| ## Running tests | ||
|
|
||
| In `haddock3` we use the pytest framework, the tests are located in `tests/` (unit) and `integration_tests/` directories. | ||
|
|
||
| ```bash | ||
| pytest | ||
| ``` | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.