From 70fa8d96665f0c5e44aacd6c782f6489fa8dc11e Mon Sep 17 00:00:00 2001 From: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> Date: Sun, 26 Nov 2023 17:55:58 +0100 Subject: [PATCH] add support for Django 5.0 and Python 3.12 (#1331) --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++++-- pyproject.toml | 4 +++- tests/test_dropbox.py | 8 ++++++++ tox.ini | 2 ++ 4 files changed, 38 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86a1ca9b..a99d402a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,13 +15,34 @@ jobs: strategy: matrix: os: [ubuntu-20.04] - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - django-version: ["3.2", "4.1", "4.2", "main"] + python-version: + - "3.7" + - "3.8" + - "3.9" + - "3.10" + - "3.11" + - "3.12" + django-version: + - "3.2" + - "4.1" + - "4.2" + - "5.0" + - "main" exclude: - python-version: "3.7" django-version: "4.1" + - python-version: "3.12" + django-version: "4.1" - python-version: "3.7" django-version: "4.2" + - python-version: "3.12" + django-version: "4.2" + - python-version: "3.7" + django-version: "5.0" + - python-version: "3.8" + django-version: "5.0" + - python-version: "3.9" + django-version: "5.0" - python-version: "3.7" django-version: "main" - python-version: "3.8" @@ -30,6 +51,8 @@ jobs: django-version: "main" - python-version: "3.11" django-version: "3.2" + - python-version: "3.12" + django-version: "3.2" steps: - uses: actions/checkout@v4 diff --git a/pyproject.toml b/pyproject.toml index 8ab4ee65..66dded8d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Framework :: Django :: 3.2", "Framework :: Django :: 4.1", "Framework :: Django :: 4.2", + "Framework :: Django :: 5.0", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", @@ -32,6 +33,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dynamic = [ "readme", @@ -49,7 +51,7 @@ boto3 = [ "boto3>=1.4.4", ] dropbox = [ - "dropbox>=7.2.1", + "dropbox>=7.2.1; python_version<'3.12'", ] google = [ "google-cloud-storage>=1.27", diff --git a/tests/test_dropbox.py b/tests/test_dropbox.py index 1dac8f9f..5417e8d6 100644 --- a/tests/test_dropbox.py +++ b/tests/test_dropbox.py @@ -1,7 +1,15 @@ import io +import sys from datetime import datetime +from unittest import SkipTest from unittest import mock +if sys.version_info >= (3, 12, 0): + raise SkipTest( + "dropbox library does not support Python 3.12+. " + "Skipping all tests in test_dropbox.py" + ) + from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import SuspiciousFileOperation from django.core.files.base import File diff --git a/tox.ini b/tox.ini index 69f004e4..aecb5ef2 100644 --- a/tox.ini +++ b/tox.ini @@ -4,6 +4,7 @@ envlist = py{3.7,3.8,3.9,3.10}-django3.2 py{3.8,3.9,3.10,3.11}-django4.1 py{3.8,3.9,3.10,3.11}-django4.2 + py{3.10,3.11,3.12}-django5.0 py{3.10,3.11,3.12}-djangomain ruff @@ -18,6 +19,7 @@ deps = django3.2: django~=3.2.9 django4.1: django~=4.1.0 django4.2: django~=4.2.0 + django5.0: django~=5.0b1 djangomain: https://github.com/django/django/archive/main.tar.gz moto pytest