Skip to content

Latest commit

 

History

History
53 lines (32 loc) · 2.68 KB

DEV_ENV_WITHOUT_DOCKER.md

File metadata and controls

53 lines (32 loc) · 2.68 KB

LOCAL DEVELOPMENT ENVIRONMENT WITHOUT DOCKER

Setting up local python virtual environment for WMG development

Install python packages needed for WMG

  1. Make sure that you have successfully completed the prerequisite installation steps

  2. Create and activate a python virtual environment using your preferred method. Some options are venv and miniconda. Here is a cheatsheet of commands to manage your virtual environment with miniconda.

    NOTE: As of this writing on 06/12/2023, you should create your virtual environment with python 3.10 or greater

    • If you have installed miniconda, here is a list of basic virtual environment management commands:

      $ conda create -n <env-name> python=3.10 # creates virtual environment
      
      $ conda activate <env-name> # activates virtual environment
      
      $ conda deactivate # deactivate virtual environment
      
    • If you are using venv, here is a list of basic virtual environment management commands:

      $ cd single-cell-data-portal # root of this code repo
      
      $ python3 -m venv venv/ # create virtual environment
      
      $ source venv/bin/activate # activate virtual environment
      
      $ deactivate # deactivate virtual environment
      
  3. Install pygraphviz - There is currently a problem with installing pygraphviz on Mac OSX. This package is needed for the WMG pipeline. The installation problem and the solution is explained here

    • brew install graphviz
    • pip install --global-option=build_ext --global-option="-I$(brew --prefix graphviz)/include/" --global-option="-L$(brew --prefix graphviz)/lib/" pygraphviz==1.11
  4. Install packages for WMG api - pip install -r python_dependencies/backend/requirements.txt

  5. Install packages for WMG pipeline - pip install -r python_dependencies/wmg/requirements.txt

Run unit tests for WMG

  1. Run unit tests for WMG api - pytest -v tests/unit/backend/wmg
  2. Run unit tests for WMG pipeline - pytest -v tests/unit/wmg_processing

Run functional tests for WMG

Run functional tests for WMG api against the dev environment. NOTE: dev environment is a remote environment. These functional tests run locally against a backend in a remote environment called dev.

  1. AWS_PROFILE=single-cell-dev DEPLOYMENT_STAGE=dev pytest -v tests/functional/backend/wmg/test_wmg_api.py