From 09e172117acff33722dc38265ad226d8392d36a0 Mon Sep 17 00:00:00 2001 From: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> Date: Sat, 18 Nov 2023 09:30:51 +0100 Subject: [PATCH] add support for Python 3.12 (except dropbox) and Django 5.0 Co-authored-by: RachellCalhoun Co-authored-by: AmiZya --- .github/workflows/ci.yml | 14 ++++++++++++++ pyproject.toml | 4 +++- tests/test_dropbox.py | 10 +++++++++- tox.ini | 2 ++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 468a9ec1..a99d402a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,16 +21,28 @@ jobs: - "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" @@ -39,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..38c6eb64 100644 --- a/tests/test_dropbox.py +++ b/tests/test_dropbox.py @@ -1,6 +1,14 @@ import io +import sys from datetime import datetime -from unittest import mock +from unittest import mock, SkipTest + + +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 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