Development environment#

This guide explains how to set up a development environment for OrangeQS Juice. We provide two different ways to set up a development environment:

  • Using a development container. Runs the development environment in an isolated container and is supported on all operating systems.

  • Manual setup. Set up an environment manually, which requires a compatible Linux distribution.

Using a development container#

We provide a dev container configuration to easily start developing on OrangeQS Juice. If you are using VS Code or any other IDE that supports dev containers you can let your development environment be set up automatically.

For example, if you are using VS Code you can follow these instructions.

  1. Follow the dev container installation instructions for VS Code.

  2. Open the folder of the Juice repository in the dev container using the Dev Containers: Open folder in Container command in the Command Palette. You should not be prompted to select a container, it should use the provided configuration at .devcontainer/devcontainer.json by default.

  3. Wait until the container is built and the development dependencies are installed.

  4. Run juice --version in your terminal to confirm that everything works.

  5. (Optional) Run pytest to run the tests.

  6. (Optional) By default the dev container only installs the orangeqs-juice-core Python package and its development dependencies. If you want to install and start a full OrangeQS Juice deployment (including JupyterHub, database, services, etc.) you can run:

    sudo juice install
    

    This will use your local editable version of the Python package in all containers. Once the full Juice deployment is completed, you can then access the Jupyterhub at http://localhost:8888 with the default username orangeqs and password OrangeQS

Note: To actually install juice, you must then also run juice install

If you encounter any issues with your dev container, remember that you can always rebuild your container to get back to a clean state. To do this in VS Code, use the Dev Containers: Rebuild Container command in the Command Palette.

Manual setup#

If you do not use VS Code or wish to set up a development environment manually for other reasons you can follow the instructions below.

System requirements#

Refer to System Requirements

Instructions#

  1. Ensure you have a (virtual) environment installed and activated with python and pip. In principle you should be able to use any environment manager, but we recommend micromamba. Using micromamba you can create and activate a virtual environment as follows:

    micromamba env create -n orangeqs-juice-core python=3.12
    micromamba activate orangeqs-juice-core
    
  2. Install the package in editable mode, along with its development dependencies.

    pip install -e ".[dev]"
    
  3. Install pre-commit hooks.

    pre-commit install
    
  4. Run the CLI to verify the installation.

    juice --version
    

    Verify that the reported installation location is your local repository.

  5. (Optional) Run pytest to run the tests.