diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b28e2c4..28f2888 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,22 +9,22 @@ jobs: fail-fast: false max-parallel: 5 matrix: - python-version: ['3.9', '3.10', '3.11', '3.12'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] services: postgres: - image: postgres:14 + image: postgres:15 env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: postgres ports: - - 5432/tcp + - 5432/tcp options: >- --health-cmd pg_isready --health-interval 10s --health-timeout 5s - --health-retries 5 + --health-retries 10 steps: - uses: actions/checkout@v4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f80e2b1..fbf1874 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - "--target-version" - "py39" - repo: https://github.com/PyCQA/flake8 - rev: "7.1.1" + rev: "7.3.0" hooks: - id: flake8 args: ["--max-line-length", "110"] @@ -18,12 +18,12 @@ repos: hooks: - id: isort - repo: https://github.com/asottile/pyupgrade - rev: v3.18.0 + rev: v3.20.0 hooks: - id: pyupgrade args: [--py39-plus] - repo: https://github.com/adamchainz/django-upgrade - rev: 1.22.1 + rev: 1.25.0 hooks: - id: django-upgrade args: [--target-version, "4.2"] diff --git a/CHANGELOG.md b/CHANGELOG.md index e3a81af..bc27396 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ #### Improvements +- Add Python 3.13 support. ([#671](https://github.com/jazzband/django-auditlog/pull/671)) - feat: Added `LogEntry.remote_port` field. ([#671](https://github.com/jazzband/django-auditlog/pull/671)) - Drop Python 3.8 support. ([#678](https://github.com/jazzband/django-auditlog/pull/678)) - Confirm Django 5.1 support and drop Django 3.2 support. ([#677](https://github.com/jazzband/django-auditlog/pull/677)) diff --git a/auditlog/models.py b/auditlog/models.py index 26e9615..614ed24 100644 --- a/auditlog/models.py +++ b/auditlog/models.py @@ -3,7 +3,7 @@ import contextlib import json from copy import deepcopy from datetime import timezone -from typing import Any, Callable, Union +from typing import Any, Callable from dateutil import parser from dateutil.tz import gettz diff --git a/auditlog_tests/test_settings.py b/auditlog_tests/test_settings.py index 6eda1cb..e89d659 100644 --- a/auditlog_tests/test_settings.py +++ b/auditlog_tests/test_settings.py @@ -1,6 +1,7 @@ """ Settings file for the Auditlog test suite. """ + import os DEBUG = True @@ -14,6 +15,7 @@ INSTALLED_APPS = [ "django.contrib.sessions", "django.contrib.admin", "django.contrib.staticfiles", + "django.contrib.postgres", "auditlog", "auditlog_tests", ] diff --git a/setup.py b/setup.py index 0bfbc3b..73da662 100644 --- a/setup.py +++ b/setup.py @@ -37,6 +37,7 @@ setup( "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Framework :: Django", "Framework :: Django :: 4.2", "Framework :: Django :: 5.0", diff --git a/tox.ini b/tox.ini index c7e845a..dae5665 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,9 @@ [tox] envlist = {py39,py310,py311}-django42 - {py310,py311,py312}-django{50,51,main} + {py310,py311,py312}-django50 + {py310,py311,py312,py313}-django51 + {py312,py313}-djangomain py39-docs py39-lint @@ -30,6 +32,7 @@ passenv= TEST_DB_PORT basepython = + py313: python3.13 py312: python3.12 py311: python3.11 py310: python3.10 @@ -51,3 +54,4 @@ python = 3.10: py310 3.11: py311 3.12: py312 + 3.13: py313