From 6d16bbb68ca1cdcd6385af7757222c2032a788bb Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Sun, 10 Dec 2023 01:51:41 -0500 Subject: [PATCH] ci: Set PYTHONPATH and install GDAL --- .github/workflows/ci.yml | 6 +++++- README.rst | 2 +- settings.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index add7354..24b4148 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,10 +15,14 @@ jobs: python-version: ${{ matrix.python-version }} cache: pip cache-dependency-path: setup.cfg + - uses: actions/setup-gdal@main + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: pip install .[test] '${{ matrix.django-version }}' psycopg2-binary - env: PORT: ${{ job.services.postgres.ports[5432] }} - run: django-admin migrate --settings settings --noinput + DJANGO_SETTINGS_MODULE: settings + run: env PYTHONPATH=$PYTHONPATH:$PWD django-admin migrate --noinput - env: PORT: ${{ job.services.postgres.ports[5432] }} run: coverage run --source=boundaries runtests.py diff --git a/README.rst b/README.rst index a02024f..7806520 100644 --- a/README.rst +++ b/README.rst @@ -54,7 +54,7 @@ Testing createdb represent_boundaries_test psql represent_boundaries_test -c 'CREATE EXTENSION postgis;' - django-admin migrate --settings settings --noinput + env DJANGO_SETTINGS_MODULE=settings django-admin migrate --noinput python runtests.py Acknowledgements diff --git a/settings.py b/settings.py index c2738f4..2f258ef 100644 --- a/settings.py +++ b/settings.py @@ -1,5 +1,5 @@ """ -To run `PYTHONPATH=$PYTHONPATH:$PWD django-admin.py migrate --settings settings --noinput`. +To run `env PYTHONPATH=$PYTHONPATH:$PWD DJANGO_SETTINGS_MODULE=settings django-admin.py migrate --noinput`. """ import os