From 029bcd79917ed4808c8d47c6132b69dd19c018dc 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 | 2 ++ tests/test_dropbox.py | 14 ++++++++++++++ tox.ini | 2 ++ 4 files changed, 32 insertions(+) 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..0d304235 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", diff --git a/tests/test_dropbox.py b/tests/test_dropbox.py index 1dac8f9f..0bc58b75 100644 --- a/tests/test_dropbox.py +++ b/tests/test_dropbox.py @@ -1,4 +1,6 @@ import io +import sys +import unittest from datetime import datetime from unittest import mock @@ -46,6 +48,10 @@ RESPONSE_500_MOCK.status_code = 500 +@unittest.skipIf( + condition=sys.version_info >= (3, 12, 0), + reason="dropbox library does not support Python 3.12+", +) class DropboxTest(TestCase): def setUp(self, *args): self.storage = dropbox.DropboxStorage("foo") @@ -151,6 +157,10 @@ def test_formats(self, *args): self.assertEqual(files, self.storage._full_path("../..")) +@unittest.skipIf( + condition=sys.version_info >= (3, 12, 0), + reason="dropbox library does not support Python 3.12+", +) class DropboxFileTest(TestCase): def setUp(self, *args): self.storage = dropbox.DropboxStorage("foo") @@ -174,6 +184,10 @@ def test_server_bad_response(self, *args): file.read() +@unittest.skipIf( + condition=sys.version_info >= (3, 12, 0), + reason="dropbox library does not support Python 3.12+", +) @mock.patch("dropbox.Dropbox.files_list_folder", return_value=FILES_EMPTY_MOCK) class DropboxRootPathTest(TestCase): def test_jailed(self, *args): 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