Skip to content

Development Environment

Geoffroy Noël edited this page Dec 15, 2019 · 5 revisions

Prerequisites

Install Poetry

Either globally

This option is convenient as you can call poetry from anywhere in your system. But it pollutes your python system environment with a lot of new packages.

cd django-controlled-vocabulary
sudo pip install "poetry<1"

OR in its own virtual environment

Preferred solution as it's more isolated. But you'll need to remember to enter the environment with source .venv/bin/activate before you can call poetry. Another advantage is this approach is that you can omit to prefix all your calls to python and its tools with poetry run (see other sections below).

cd django-controlled-vocabulary
python -m venv .venv
source .venv/bin/activate
pip install pip -U
pip install poetry

THEN install dependent packages

poetry install

Run Django tests

cd tests
poetry run python manage.py test controlled_vocabulary

To check code coverage of the tests:

poetry run coverage run --include "*controlled_vocabulary*" tests/manage.py test controlled_vocabulary
poetry run coverage report

Run Django testing app

cd tests
poetry shell
./manage.py migrate
./manage.py vocab init
./manage.py runserver 0:8000

Run Tox tests

poetry run tox

Build package & Publish to Pypi

poetry version
poetry build
poetry publish