Development

If you are developing or want to contribute to Solosis, please read this page.

  1. Log-in to Farm

  2. If you haven’t already, create a directory for your Git repository in your home directory.

Ensure you are in your home directory

pwd
Expected Output
/nfs/users/nfs_l/<USER>

Then create the directory

mkdir repos
cd repos/
  1. Clone the solosis git repository

git clone git@github.com:haniffalab/solosis.git
cd solosis
  1. Export environment variables

export export LSB_DEFAULT_USERGROUP=<USERGROUP>
export TEAM_DATA_DIR=/lustre/scratch126/cellgen/team298/data
export TEAM_LOGS_DIR=/lustre/scratch126/cellgen/team298/logs
  1. Set-up new git branch

Check which branch you’re currently in

git status
Expected Output
On branch dev
Your branch is up-to-date with 'origin/dev'.

Move to dev branch

git checkout dev

Create a new branch (off dev branch) to begin contributing. More info here

git checkout -b <new-branch>

For information on Naming nomenclature of git branches view this page

  1. Executing solosis commands

Executing solosis commands while developing need to solosis-cli to be as follows:

./solosis-cli
  1. Committing changes to dev branch

Run the following commands:

git add .
git commit -m "ADD MESSAGE HERE"
git push

Once changes are complete, create Pull Request to merge changes to dev.

pytest

Create and activate the virtual environment

python -m venv .venv
source .venv/bin/activate

Install dev dependencies and install pre-commit hooks

pip install --upgrade pip
python -m pip install -r envs/requirements.txt
python -m pip install -r envs/dev-requirements.txt
python -m pip install -r envs/doc-requirements.txt
pre-commit install

Run Solosis in development mode

python -m solosis.cli

The pre-commit config includes black formatting and isort are implemented. You can manually check black formatting and isort as follows:

black path/to/file.py
isort path/to/file.py

Python testing

Set the PYTHONPATH environment variable to the bin directory where the scripts are stored, and then run the following command:

python -m pytest -q tests/test_cli.py