Skip to content

Commit

Permalink
Test on python 3.10 (#2838)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
hmpf and lunkwill42 authored Mar 5, 2024
1 parent 45c2149 commit 3e434bc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/publish-test-results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion python/nav/web/webfront/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import json
import logging
from operator import attrgetter
from urllib.parse import quote as urlquote

from django.http import (
HttpResponseForbidden,
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -19,6 +22,7 @@ markers =
python =
3.7: py37
3.9: py39
3.10: py310

[testenv]
# Baseline test environment
Expand Down

0 comments on commit 3e434bc

Please sign in to comment.