From 3e434bc8f6c50284f1fd0b87189a0103d158d949 Mon Sep 17 00:00:00 2001 From: Hanne Moa Date: Tue, 5 Mar 2024 08:16:12 +0100 Subject: [PATCH] Test on python 3.10 (#2838) * Set up test envs for Python 3.10 We should've been testing for Python 3.10 for a long time now, it's time to start! * Publish test results even when branch is on origin Can't remember why this restriction was put in there, but it seems it prevents test results from being published when PR's repo is the same as the origin. Also don't understand or remember why the dependabot restriction is in here. Removing that too. * Replace django urlquote with urllib.parse.quote --------- Co-authored-by: Morten Brekkevold --- .github/workflows/build-and-test.yml | 2 +- .github/workflows/publish-test-results.yml | 5 +---- python/nav/web/webfront/views.py | 2 +- tests/docker/Dockerfile | 1 + tox.ini | 6 +++++- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index d06724ee13..4560c11d73 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -9,7 +9,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [3.7, 3.9] + python-version: ["3.7", "3.9", "3.10"] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/publish-test-results.yml b/.github/workflows/publish-test-results.yml index ac897d86ae..da798e1b9d 100644 --- a/.github/workflows/publish-test-results.yml +++ b/.github/workflows/publish-test-results.yml @@ -11,10 +11,7 @@ jobs: name: "Publish test results" runs-on: ubuntu-latest if: > - github.event.workflow_run.conclusion != 'skipped' && ( - github.event.sender.login == 'dependabot[bot]' || - github.event.workflow_run.head_repository.full_name != github.repository - ) + github.event.workflow_run.conclusion != 'skipped' steps: - name: Download and Extract Artifacts diff --git a/python/nav/web/webfront/views.py b/python/nav/web/webfront/views.py index 0c9e5eeca1..c98f0e7732 100644 --- a/python/nav/web/webfront/views.py +++ b/python/nav/web/webfront/views.py @@ -21,6 +21,7 @@ import json import logging from operator import attrgetter +from urllib.parse import quote as urlquote from django.http import ( HttpResponseForbidden, @@ -32,7 +33,6 @@ from django.views.decorators.debug import sensitive_variables, sensitive_post_parameters from django.shortcuts import get_object_or_404, render from django.urls import reverse -from django.utils.http import urlquote from nav.auditlog.models import LogEntry from nav.django.utils import get_account diff --git a/tests/docker/Dockerfile b/tests/docker/Dockerfile index 2a97f4a76c..650f5aa1ed 100644 --- a/tests/docker/Dockerfile +++ b/tests/docker/Dockerfile @@ -19,6 +19,7 @@ RUN add-apt-repository ppa:deadsnakes/ppa && \ curl git build-essential \ python3.7-dbg python3.7-dev python3.7-distutils \ python3.9-dbg python3.9-dev \ + python3.10-dbg python3.10-dev \ python3-pip RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list diff --git a/tox.ini b/tox.ini index f1213259d5..e20f271966 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,10 @@ # When changing the python or django version also change it in the tox example # of the documentation in hacking.rst [tox] -envlist = {unit,integration,functional}-py{37,39}-django{32}, javascript, docs +envlist = + {unit,integration,functional}-py{37,39,310}-django{32} + javascript + docs skipsdist = True basepython = python3.7 @@ -19,6 +22,7 @@ markers = python = 3.7: py37 3.9: py39 + 3.10: py310 [testenv] # Baseline test environment