Skip to content
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

Dev/dev docs #259

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 45 additions & 13 deletions docs/dev_docs/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,49 @@
Development Environment Set-up
==============================

Download GwasQcPipeline
-----------------------

First we need to download the development version of GwasQcPipeline.::
Install ``poetry``
------------------

$ git clone --recursive https://github.com/NCI-CGR/GwasQcPipeline.git
$ cd GwasQcPipeline
First we need to download poetry by using the official `Poetry installer`_.::

.. note::
$ curl -sSL https://install.python-poetry.org | python -
$ poetry --version

Our test data (``tests/data``) is stored in a separate git repository.
This repository is embedded as a git submodule. The ``--recursive`` tells git to go ahead and download ``tests/data``.
.. _Poetry installer: https://python-poetry.org/docs/#installation
.. _instructions: https://www.baeldung.com/linux/default-python3

.. note::

If poetry version not accesible, check your PATH and ensure poetry's install location is findable.
If default python version is not 3.8, then follow these `instructions`_.

Create a virtual environment (``conda``)
----------------------------------------

We are going to create a ``conda`` virtual environment to store the development environment.
If you need to install ``conda`` see the `Miniconda website`_.
If you need to install ``conda`` see the `Miniconda website`_. We reccomend installing conda locally::

$ wget https://repo.anaconda.com/miniconda/Miniconda3-py38_4.12.0-Linux-x86_64.sh
$ bash Miniconda3-py38_4.12.0-Linux-x86_64.sh -p miniconda3 -b
$ echo "export PATH=$(pwd)/miniconda3/bin:$PATH" >> ~/.bashrc
$ source ~/.bashrc
$ conda init

Restart you terminal.

Next you need to setup three channels in your conda config by running the following::

$ export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
$ conda update -n base -c defaults conda
$ conda install -n base -c conda-forge mamba
$ conda config --add channels defaults
$ conda config --add channels bioconda
$ conda config --add channels conda-forge

Next, To create our ``conda`` environment run::

$ conda create -n cgr-dev python=3.8 poetry make -y
$ conda create -n cgr-dev python=3.8 -y
$ conda activate cgr-dev # This activates the virtual environment

.. _Miniconda website: https://docs.conda.io/en/latest/miniconda.html
Expand All @@ -42,6 +56,20 @@ Next, To create our ``conda`` environment run::
If you have ``gcc`` installed, they should be automatically built during the installation step below.
However, if you have problems you may want to install them with ``conda activate cgr-dev && conda install psutil pysam``.

Download GwasQcPipeline
-----------------------

Download the development version of GwasQcPipeline.::

$ git clone --recursive https://github.com/NCI-CGR/GwasQcPipeline.git
$ cd GwasQcPipeline

.. note::

Our test data (``tests/data``) is stored in a separate git repository.
This repository is embedded as a git submodule. The ``--recursive`` tells git to go ahead and download ``tests/data``.


Install dependencies and GwasQcPipeline (``poetry``)
----------------------------------------------------

Expand All @@ -53,13 +81,17 @@ Poetry is a modern python build tool that uses the ``pyproject.toml`` format to
To install all runtime/development dependencies and GwasQcPipeline itself run::

$ conda activate cgr-dev # Make sure we are in our conda environment
$ poetry env use /PATH/TO/miniconda3/envs/cgr-dev/bin/python # Enable poetry to manage your conda environment
$ poetry config virtualenvs.path /PATH/TO/miniconda3/envs/cgr-dev #This needs to be full path
$ poetry env info # This should show that both system and virtual env python is 3.8 and that the venv is conda
$ poetry install # Install development and runtime dependencies
$ cgr version

Now lets make sure everything is working::

$ cgr --help # This is our main entry point to running the workflow
$ make -C docs html # This will build documentation into docs/_build/html
$ pytest -v # This will run the test suite
$ poetry run pytest -vvv # This will run the test suite

The main reason we are using poetry is because it makes building python packages easy.
In order to match the new config.yaml version line with the new QwasQcPipeline version
Expand All @@ -68,8 +100,8 @@ edit and update the ``version = "0.1.2"`` line in the ``pyproject.toml`` file::
$ poetry build # Build artifacts are in ./dist

Once the changes are pushed to Github, tag the new version for release. While Github is building
the new release, a drop and drag box will appear for additional assets. Add the new
cgr_gwas_qc-X.X.X.tar.gz and cgr_gwas_qc-X.X.X-py3-none-any.whl files to the box.
the new release, a drop and drag box will appear for additional assets. Add the new
cgr_gwas_qc-X.X.X.tar.gz and cgr_gwas_qc-X.X.X-py3-none-any.whl files to the box.


Install pre-commit hooks for consistent development
Expand Down
11 changes: 1 addition & 10 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ seaborn = "^0.12.2"
python-ternary = "^1.0.8"
tabulate = "^0.8.0"
openpyxl = "^3.1.2"
markupsafe = "^2.1.3"
markupsafe = "~2.0"

[tool.poetry.dev-dependencies]
black = { version = "^19.10b0", allow-prereleases = true }
Expand Down
2 changes: 1 addition & 1 deletion tests/data
Submodule data updated from 5def84 to 73eddd
Loading