Skip to content

Latest commit

 

History

History
76 lines (53 loc) · 2.57 KB

README.dev.md

File metadata and controls

76 lines (53 loc) · 2.57 KB

Developer documentation

If you're looking for user documentation, go here.

Development installation

Follow the instruction below to set up a development environment. We use Python 3.10 and Django 4.0.x for development.

Requirements

Create a virtual environment

Create a virtual environment, activate it, and install the development dependencies in it. This will enable you to run the tests and web-apps later. For Windows read here.

# Create a virtual environment, e.g. with
python3 -m venv ./venv

# activate virtual environment
source venv/bin/activate

# make sure to have a recent version of pip and setuptools
python3 -m pip install --upgrade pip setuptools

# (from the project root directory)
# install development dependencies
pip install -r requirements.txt

Running the Django App

  1. Create a .env file with a secret key for the django project, and the database configuration, such as:

    # .env file in ./citizenvoice/
    SECRET_KEY = 'django-insecure-<a hexadecimal string>'
    POSTGRES_USER = '<username>'
    POSTGRES_DBASE = '<database-name>'
    POSTGRES_PWD = '<password>'
    POSTGRES_HOST = '<server-name/IP>'
    POSTGRES_PORT = '<port-number>'
  2. Run the development server from the project directory. Saved changes will be authomatically reloaded:

    python manage.py runserver

Running the tests

Running the tests requires an activated virtual environment with the development tools installed.

# unit tests
cd ./citizenvoice
python manage.py test

Making a release

Preparation

  1. Make sure the CHANGELOG.md has been updated
  2. Verify that the information in CITATION.cff is correct, and that .zenodo.json contains equivalent data
  3. Make sure that version in setup.cfg and version in CITATION.cff have been bumped to the to-be-released version of the template
  4. Run the unit tests with python manage.py test
  5. Go through the steps outlined above for generating a new package from the command line, and verify that the generated package works as it should.

GitHub

  1. Make sure that the GitHub-Zenodo integration is enabled for https://github.com/NLeSC/python-template
  2. Go to https://github.com/NLeSC/python-template/releases and click Draft a new release