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.
Follow the dev container installation instructions for VS Code.
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.jsonby default.Wait until the container is built and the development dependencies are installed.
Run
juice --versionin your terminal to confirm that everything works.(Optional) Run
pytestto run the tests.(Optional) By default the dev container only installs the
orangeqs-juice-corePython 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
orangeqsand passwordOrangeQS
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#
Ensure you have a (virtual) environment installed and activated with
pythonandpip. 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
Install the package in editable mode, along with its development dependencies.
pip install -e ".[dev]"
Install pre-commit hooks.
pre-commit installRun the CLI to verify the installation.
juice --versionVerify that the reported installation location is your local repository.
(Optional) Run
pytestto run the tests.