Build and Run

These instructions can be used to build and run the project.


1. Initialize dev environment

make environment


pipenv install --dev

2. Install the electionguard module in edit mode

make install


pipenv run python -m pip install -e .

⚠️ Note: For Windows without make, use supplied precompiled gmpy2 package with the --find-links or -f option. The 32 vs 64 bit is based on your installed python version NOT your system.

Determine if 64-bit:

This code snippet will read true for 64 bit.

python -c 'from sys import maxsize; print(maxsize > 2**32)

Install module with link

  • 32-bit: pipenv run pip install -f packages/gmpy2-2.0.8-cp38-cp38-win32.whl -e .
  • 64-bit: pipenv run pip install -f packages/gmpy2-2.0.8-cp38-cp38-win_amd64 -e .

3. Validate import of module (Optional)

make validate


pipenv run python -c 'import electionguard; print(electionguard.__package__ + " successfully imported")'


Option 1: Code Coverage

make coverage


pipenv run coverage report

Option 2: Run tests in VS Code

Install recommended test explorer extensions and run unit tests through tool.

⚠️ Note: For Windows, be sure to select the virtual environment Python interpreter.

Option 3: Run test command

make test


pipenv run python -m pytest /testss