diff --git a/docs/dev_docs/setup.rst b/docs/dev_docs/setup.rst index 35597244..e13285dc 100644 --- a/docs/dev_docs/setup.rst +++ b/docs/dev_docs/setup.rst @@ -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 @@ -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``) ---------------------------------------------------- @@ -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 @@ -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 diff --git a/poetry.lock b/poetry.lock index 5cdcad82..1da2c0e5 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2639,15 +2639,6 @@ files = [ {file = "rpds_py-0.10.3-pp39-pypy39_pp73-macosx_10_7_x86_64.whl", hash = "sha256:f602881d80ee4228a2355c68da6b296a296cd22bbb91e5418d54577bbf17fa7c"}, {file = "rpds_py-0.10.3-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:691d50c99a937709ac4c4cd570d959a006bd6a6d970a484c84cc99543d4a5bbb"}, {file = "rpds_py-0.10.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:24cd91a03543a0f8d09cb18d1cb27df80a84b5553d2bd94cba5979ef6af5c6e7"}, - {file = "rpds_py-0.10.3-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fc2200e79d75b5238c8d69f6a30f8284290c777039d331e7340b6c17cad24a5a"}, - {file = "rpds_py-0.10.3-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ea65b59882d5fa8c74a23f8960db579e5e341534934f43f3b18ec1839b893e41"}, - {file = "rpds_py-0.10.3-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:829e91f3a8574888b73e7a3feb3b1af698e717513597e23136ff4eba0bc8387a"}, - {file = "rpds_py-0.10.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eab75a8569a095f2ad470b342f2751d9902f7944704f0571c8af46bede438475"}, - {file = "rpds_py-0.10.3-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:061c3ff1f51ecec256e916cf71cc01f9975af8fb3af9b94d3c0cc8702cfea637"}, - {file = "rpds_py-0.10.3-pp39-pypy39_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:39d05e65f23a0fe897b6ac395f2a8d48c56ac0f583f5d663e0afec1da89b95da"}, - {file = "rpds_py-0.10.3-pp39-pypy39_pp73-musllinux_1_2_i686.whl", hash = "sha256:4eca20917a06d2fca7628ef3c8b94a8c358f6b43f1a621c9815243462dcccf97"}, - {file = "rpds_py-0.10.3-pp39-pypy39_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:e8d0f0eca087630d58b8c662085529781fd5dc80f0a54eda42d5c9029f812599"}, - {file = "rpds_py-0.10.3.tar.gz", hash = "sha256:fcc1ebb7561a3e24a6588f7c6ded15d80aec22c66a070c757559b57b17ffd1cb"}, ] [[package]] @@ -3546,4 +3537,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "8b3b975f0f62657581d3e5e02df48632a3157c1fd47b09ea41cd82ad5cb04a9a" +content-hash = "375537fb2f7f917909091d7d0c5051bb89622cd77545b82fea8a60e7396db0b5" diff --git a/pyproject.toml b/pyproject.toml index c0a84b71..0ce997fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 } diff --git a/tests/data b/tests/data index 5def846f..73eddd8a 160000 --- a/tests/data +++ b/tests/data @@ -1 +1 @@ -Subproject commit 5def846ff2b0459b3bee4711a32481e14c5e2f58 +Subproject commit 73eddd8a496a083038bd9b15d0a03ba5e4cccc4e