-
Notifications
You must be signed in to change notification settings - Fork 5
Getting Started with BallotLab
Neil Johnson edited this page Jun 1, 2022
·
3 revisions
BallotLab, a Python project, uses Poetry for dependency management. To get started:
- Clone this repo, or create a fork, on your development workstation.
- Install Poetry on your development workstation (if needed).
- At the command line, use
cd
to go to the project's root directory in your repo. - Run
poetry install
to configure your virtual environment and add all the required python packages. - Run
poetry shell
to invoke the virtual environment.
The developer tools used in this project were inspired by How to set up a perfect Python project.
TL;DR: here's a summary listing of the bash commands from that article:
cd [vour/repo/directory]
# install pipenv (system-wide)
pip install pipenv
# set up pipenv with python 3.9
pipenv install --python 3.9
# install development tools
pipenv install isort --dev
# currently, black is pre-release so use the --pre flag
pipenv install black --pre --dev
pipenv install flake8 --dev
pipenv install mypy --dev
pipenv install pytest pytest-cov --dev
Once you've set up your development environment, install the required Python packages:
# Create PDF ballot files
pipenv install reportlab
# Add images to PDF files (replaces deprecated PIL)
pipenv install pillow
# (optional) extract text from PDFs
pipenv install pdfminer.six
Note that the use of poetry
as your package manager, following the steps at the top of this page, will handle all of these dependencies.