Skip to content

Commit

Permalink
Add support for Django 5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuadavidthomas committed Jan 21, 2025
1 parent 01eb47b commit bd8031d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ and this project attempts to adhere to [Semantic Versioning](https://semver.org/

## [Unreleased]

### Added

- Added support for Django 5.1.

### Removed

- Dropped support for Python 3.8.
Expand Down
9 changes: 7 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@

DJ42 = "4.2"
DJ50 = "5.0"
DJ51 = "5.1"
DJMAIN = "main"
DJMAIN_MIN_PY = PY312
DJ_VERSIONS = [DJ42, DJ50, DJMAIN]
DJ_VERSIONS = [DJ42, DJ50, DJ51, DJMAIN]
DJ_LTS = [
version for version in DJ_VERSIONS if version.endswith(".2") and version != DJMAIN
]
Expand All @@ -37,7 +38,11 @@ def should_skip(python: str, django: str) -> bool:
"""Return True if the test should be skipped"""

if django == DJMAIN and version(python) < version(DJMAIN_MIN_PY):
# Django main requires Python 3.10+
# Django main requires Python 3.12+
return True

if django == DJ51 and version(python) < version(PY310):
# Django 5.1 requires Python 3.10+
return True

if django == DJ50 and version(python) < version(PY310):
Expand Down
21 changes: 11 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ build-backend = "hatchling.build"
requires = ["hatchling"]

[project]
authors = [{name = "Josh Thomas", email = "[email protected]"}]
authors = [{ name = "Josh Thomas", email = "[email protected]" }]
classifiers = [
"Development Status :: 3 - Alpha",
"Framework :: Django",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Framework :: Django :: 5.1",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
Expand All @@ -18,13 +19,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"
Expand All @@ -47,7 +48,7 @@ dev = [
"pytest-django",
"pytest-randomly",
"pytest-reverse",
"pytest-xdist"
"pytest-xdist",
]
docs = [
"cogapp",
Expand All @@ -56,7 +57,7 @@ docs = [
"sphinx",
"sphinx-autobuild",
"sphinx-copybutton",
"sphinx-inline-tabs"
"sphinx-inline-tabs",
]
lint = ["pre-commit"]

Expand All @@ -69,7 +70,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]"

Expand All @@ -88,7 +89,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

Expand Down Expand Up @@ -158,7 +159,7 @@ exclude = [
"dist",
"migrations",
"node_modules",
"venv"
"venv",
]
extend-include = ["*.pyi?"]
indent-width = 4
Expand All @@ -180,13 +181,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 = []

Expand Down

0 comments on commit bd8031d

Please sign in to comment.