From 564dd7fd97076ac21d2c416741c7f8bb8c32a82c Mon Sep 17 00:00:00 2001 From: Andrew Northall Date: Fri, 7 Feb 2025 04:37:30 +0000 Subject: [PATCH] ops: update python tests ci --- .github/workflows/run-tests.yaml | 6 +++--- conf/__init__.py | 0 conf/settings.py | 16 ++-------------- reportdb/manage.py | 2 -- 4 files changed, 5 insertions(+), 19 deletions(-) create mode 100644 conf/__init__.py diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index a42fbaa..235bc48 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -25,12 +25,12 @@ jobs: uses: astral-sh/setup-uv@v5 - name: Install dependencies - run: | - uv sync --frozen + run: uv sync --frozen - name: Run Django tests env: - PYTHONPATH: ${{ github.workspace }}/reportdb + PYTHONPATH: ${{ github.workspace }} + DJANGO_SETTINGS_MODULE: conf.settings run: | uv run reportdb/manage.py test diff --git a/conf/__init__.py b/conf/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/conf/settings.py b/conf/settings.py index 25226a5..19fd08e 100644 --- a/conf/settings.py +++ b/conf/settings.py @@ -1,14 +1,3 @@ -"""Django settings for reportdb project. - -Generated by 'django-admin startproject' using Django 4.2.1. - -For more information on this file, see -https://docs.djangoproject.com/en/4.2/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/4.2/ref/settings/ -""" - import os import socket from pathlib import Path @@ -64,8 +53,7 @@ "debug_toolbar.middleware.DebugToolbarMiddleware", ] -# noinspection PyUnresolvedReferences -ROOT_URLCONF = "reportdb.urls" +ROOT_URLCONF = "conf.urls" TEMPLATES = [ { @@ -84,7 +72,7 @@ }, ] -WSGI_APPLICATION = "reportdb.wsgi.application" +WSGI_APPLICATION = "conf.wsgi.application" # Database diff --git a/reportdb/manage.py b/reportdb/manage.py index 216bd84..8ad6695 100755 --- a/reportdb/manage.py +++ b/reportdb/manage.py @@ -1,13 +1,11 @@ #!/usr/bin/env python """Django's command-line utility for administrative tasks.""" -import os import sys def main() -> None: """Run administrative tasks.""" - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "reportdb.settings") try: from django.core.management import execute_from_command_line except ImportError as exc: