Development Environment#

Follow the steps below to get an OpenDP development environment set up, including the ability to run tests in both Rust and Python.

Install Rust#

Download Rust from the Rust website.

Install Python#

Download Python from the Python website.

Clone the OpenDP Repo#

Clone the repo and change into the opendp directory that’s created.

git clone
cd opendp

Build OpenDP#

Change to the rust directory before attempting a build, run the tests, and then return to the opendp directory.

cd rust
cargo build
cargo test
cd ..

Add –features=untrusted to the cargo commands to include non-secure floating-point and contrib features like make_base_laplace. If you are on Windows, [check the windows build instructions](opendp/opendp).

Install Python Dependencies#

Change to the python directory, create a Python virtual environment, activate it, install dependencies, and then install the Python OpenDP library itself.

cd python
python3 -m venv venv
source venv/bin/activate
pip install flake8 pytest
mkdir src/opendp/lib
pip install -e .

The developer install will not work if you don’t use the -e flag when installing with pip!

Run the Tests#

From the python directory, set an environment variable to the location of the OpenDP library you built. Then run the tests.

export OPENDP_LIB_DIR=../rust/target/debug
pytest -v