From c8451a5a815e98941dac5da343453a4ea32c4197 Mon Sep 17 00:00:00 2001 From: Josh Date: Tue, 21 Jan 2025 11:48:17 -0600 Subject: [PATCH] Add support for Django 5.2 --- CHANGELOG.md | 2 +- noxfile.py | 7 ++++++- pyproject.toml | 21 +++++++++++---------- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc45cd8..dd3a36a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ and this project attempts to adhere to [Semantic Versioning](https://semver.org/ ### Added -- Added support for Django 5.1. +- Added support for Django 5.1 and 5.2. ### Removed diff --git a/noxfile.py b/noxfile.py index dac070b..9946913 100644 --- a/noxfile.py +++ b/noxfile.py @@ -19,9 +19,10 @@ DJ42 = "4.2" DJ50 = "5.0" DJ51 = "5.1" +DJ52 = "5.2a1" DJMAIN = "main" DJMAIN_MIN_PY = PY312 -DJ_VERSIONS = [DJ42, DJ50, DJ51, DJMAIN] +DJ_VERSIONS = [DJ42, DJ50, DJ51, DJ52, DJMAIN] DJ_LTS = [ version for version in DJ_VERSIONS if version.endswith(".2") and version != DJMAIN ] @@ -41,6 +42,10 @@ def should_skip(python: str, django: str) -> bool: # Django main requires Python 3.12+ return True + if django == DJ52 and version(python) < version(PY310): + # Django 5.2 requires Python 3.10+ + return True + if django == DJ51 and version(python) < version(PY310): # Django 5.1 requires Python 3.10+ return True diff --git a/pyproject.toml b/pyproject.toml index 57f941e..39e1916 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,13 +3,14 @@ build-backend = "hatchling.build" requires = ["hatchling"] [project] -authors = [{name = "Josh Thomas", email = "josh@joshthomas.dev"}] +authors = [{ name = "Josh Thomas", email = "josh@joshthomas.dev" }] classifiers = [ "Development Status :: 3 - Alpha", "Framework :: Django", "Framework :: Django :: 4.2", "Framework :: Django :: 5.0", "Framework :: Django :: 5.1", + "Framework :: Django :: 5.2", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", @@ -19,13 +20,13 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: Implementation :: CPython" + "Programming Language :: Python :: Implementation :: CPython", ] dependencies = ["django>=4.2"] description = "A custom Django field for storing and securely accessing a 1Password vault item." dynamic = ["version"] keywords = [] -license = {file = "LICENSE"} +license = { file = "LICENSE" } name = "django-opfield" readme = "README.md" requires-python = ">=3.9" @@ -48,7 +49,7 @@ dev = [ "pytest-django", "pytest-randomly", "pytest-reverse", - "pytest-xdist" + "pytest-xdist", ] docs = [ "cogapp", @@ -57,7 +58,7 @@ docs = [ "sphinx", "sphinx-autobuild", "sphinx-copybutton", - "sphinx-inline-tabs" + "sphinx-inline-tabs", ] lint = ["pre-commit"] @@ -70,7 +71,7 @@ Source = "https://github.com/westerveltco/django-opfield" commit = true commit_message = ":bookmark: bump version {old_version} -> {new_version}" current_version = "0.1.1" -push = false # set to false for CI +push = false # set to false for CI tag = false version_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]" @@ -89,7 +90,7 @@ exclude_lines = [ "if not DEBUG:", "if settings.DEBUG:", "if TYPE_CHECKING:", - 'def __str__\(self\)\s?\-?\>?\s?\w*\:' + 'def __str__\(self\)\s?\-?\>?\s?\w*\:', ] fail_under = 75 @@ -159,7 +160,7 @@ exclude = [ "dist", "migrations", "node_modules", - "venv" + "venv", ] extend-include = ["*.pyi?"] indent-width = 4 @@ -181,13 +182,13 @@ quote-style = "double" dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" # Allow autofix for all enabled rules (when `--fix`) is provided. fixable = ["A", "B", "C", "D", "E", "F", "I"] -ignore = ["E501", "E741"] # temporary +ignore = ["E501", "E741"] # temporary select = [ "B", # flake8-bugbear "E", # Pycodestyle "F", # Pyflakes "I", # isort - "UP" # pyupgrade + "UP", # pyupgrade ] unfixable = []