Skip to content

Commit a92d729

Browse files
drop support for Django 5.0 (#65)
1 parent 2bf73ea commit a92d729

File tree

10 files changed

+80
-25
lines changed

10 files changed

+80
-25
lines changed

.just/documentation.just

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ serve PORT="8000": cog
2828
[no-cd]
2929
[private]
3030
cog:
31-
uv run --extra docs cog -r docs/development/just.md
31+
uv run --with cogapp cog -r CONTRIBUTING.md README.md pyproject.toml

.pre-commit-config.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ repos:
2828
additional_dependencies:
2929
- black==22.12.0
3030

31-
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
32-
rev: v2.14.0
33-
hooks:
34-
- id: pretty-format-toml
35-
args: [--autofix]
36-
3731
- repo: https://github.com/abravalheri/validate-pyproject
3832
rev: v0.24.1
3933
hooks:

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ and this project attempts to adhere to [Semantic Versioning](https://semver.org/
2222

2323
- Added support for Django 5.2.
2424

25+
### Removed
26+
27+
- Dropped support for Django 5.0.
28+
2529
### Fixed
2630

2731
- Fixed a discrepancy between what the documentation showed about the type expected for `APP_ID` in the `GITHUB_APP` settings dictionary and how the library actually used the setting when creating a new `Installation` instance via the `acreate_from_event`/`create_from_event` custom manager methods.

CONTRIBUTING.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,19 @@ $ # just --list --list-submodules
5050

5151
Available recipes:
5252
bootstrap
53-
coverage
53+
coverage *ARGS
5454
lint
5555
lock *ARGS
56+
manage *COMMAND
5657
test *ARGS
5758
testall *ARGS
5859
types *ARGS
5960
docs:
6061
build LOCATION="docs/_build/html" # Build documentation using Sphinx
6162
serve PORT="8000" # Serve documentation locally
63+
project:
64+
bump *ARGS
65+
release *ARGS
6266
```
6367
<!-- [[[end]]] -->
6468

README.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@
22

33
[![PyPI](https://img.shields.io/pypi/v/django-github-app)](https://pypi.org/project/django-github-app/)
44
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django-github-app)
5-
![Django Version](https://img.shields.io/badge/django-4.2%20%7C%205.0%20%7C%205.1%20%7C%205.2-%2344B78B?labelColor=%23092E20)
6-
<!-- https://shields.io/badges -->
7-
<!-- django-4.2 | 5.0 | 5.1 | 5.2-#44B78B -->
8-
<!-- labelColor=%23092E20 -->
5+
<!-- [[[cog
6+
import subprocess
7+
import cog
8+
9+
from noxfile import DJ_VERSIONS
10+
from noxfile import PY_VERSIONS
11+
12+
cog.outl(f"![Django Version](https://img.shields.io/badge/django-{'%20%7C%20'.join(DJ_VERSIONS)}-%2344B78B?labelColor=%23092E20)")
13+
]]] -->
14+
![Django Version](https://img.shields.io/badge/django-4.2%20%7C%205.1%20%7C%205.2%20%7C%20main-%2344B78B?labelColor=%23092E20)
15+
<!-- [[[end]]] -->
916

1017
A Django toolkit providing the batteries needed to build GitHub Apps - from webhook handling to API integration.
1118

@@ -15,8 +22,19 @@ Fully supports both sync (WSGI) and async (ASGI) Django applications.
1522

1623
## Requirements
1724

25+
<!-- [[[cog
26+
import subprocess
27+
import cog
28+
29+
from noxfile import DJ_VERSIONS
30+
from noxfile import PY_VERSIONS
31+
32+
cog.outl(f"- Python {', '.join([version for version in PY_VERSIONS])}")
33+
cog.outl(f"- Django {', '.join([version for version in DJ_VERSIONS if version != 'main'])}")
34+
]]] -->
1835
- Python 3.10, 3.11, 3.12, 3.13
19-
- Django 4.2, 5.0, 5.1, 5.2
36+
- Django 4.2, 5.1, 5.2
37+
<!-- [[[end]]] -->
2038

2139
## Installation
2240

noxfile.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@
1818
PY_LATEST = PY_VERSIONS[-1]
1919

2020
DJ42 = "4.2"
21-
DJ50 = "5.0"
2221
DJ51 = "5.1"
2322
DJ52 = "5.2"
2423
DJMAIN = "main"
2524
DJMAIN_MIN_PY = PY312
26-
DJ_VERSIONS = [DJ42, DJ50, DJ51, DJ52, DJMAIN]
25+
DJ_VERSIONS = [DJ42, DJ51, DJ52, DJMAIN]
2726
DJ_LTS = [
2827
version for version in DJ_VERSIONS if version.endswith(".2") and version != DJMAIN
2928
]
@@ -51,10 +50,6 @@ def should_skip(python: str, django: str) -> bool:
5150
# Django 5.1 requires Python 3.10+
5251
return True
5352

54-
if django == DJ50 and version(python) < version(PY310):
55-
# Django 5.0 requires Python 3.10+
56-
return True
57-
5853
return False
5954

6055

pyproject.toml

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,40 @@ authors = [
3434
classifiers = [
3535
"Development Status :: 4 - Beta",
3636
"Framework :: Django",
37+
# [[[cog
38+
# import subprocess
39+
# import cog
40+
#
41+
# from noxfile import DJ_VERSIONS
42+
#
43+
# for version in DJ_VERSIONS:
44+
# if version == "main":
45+
# continue
46+
# cog.outl(f' "Framework :: Django :: {version}",')
47+
# ]]] -->
3748
"Framework :: Django :: 4.2",
38-
"Framework :: Django :: 5.0",
3949
"Framework :: Django :: 5.1",
4050
"Framework :: Django :: 5.2",
51+
# [[[end]]]
4152
"License :: OSI Approved :: MIT License",
4253
"Operating System :: OS Independent",
4354
"Programming Language :: Python",
4455
"Programming Language :: Python :: 3",
4556
"Programming Language :: Python :: 3 :: Only",
57+
# [[[cog
58+
# import subprocess
59+
# import cog
60+
#
61+
# from noxfile import PY_VERSIONS
62+
#
63+
# for version in PY_VERSIONS:
64+
# cog.outl(f' "Programming Language :: Python :: {version}",')
65+
# ]]] -->
4666
"Programming Language :: Python :: 3.10",
4767
"Programming Language :: Python :: 3.11",
4868
"Programming Language :: Python :: 3.12",
4969
"Programming Language :: Python :: 3.13",
70+
# [[[end]]]
5071
"Programming Language :: Python :: Implementation :: CPython"
5172
]
5273
dependencies = [
@@ -61,7 +82,16 @@ dynamic = ["version"]
6182
license = {file = "LICENSE"}
6283
name = "django-github-app"
6384
readme = "README.md"
85+
# [[[cog
86+
# import subprocess
87+
# import cog
88+
#
89+
# from noxfile import PY_VERSIONS
90+
#
91+
# cog.outl(f'requires-python = ">={PY_VERSIONS[0]}"')
92+
# ]]] -->
6493
requires-python = ">=3.10"
94+
# [[[end]]]
6595

6696
[project.urls]
6797
Documentation = "https://github.com/joshuadavidthomas/django-github-app#README"
@@ -188,8 +218,18 @@ extend-include = ["*.pyi?"]
188218
indent-width = 4
189219
# Same as Black.
190220
line-length = 88
191-
# Assume Python >3.8
192-
target-version = "py38"
221+
# [[[cog
222+
# import subprocess
223+
# import cog
224+
#
225+
# from noxfile import PY_VERSIONS
226+
#
227+
# cog.outl(f"# Assume Python >{PY_VERSIONS[0]}")
228+
# cog.outl(f'target-version = "py{PY_VERSIONS[0].replace(".", "")}"')
229+
# ]]] -->
230+
# Assume Python >3.10
231+
target-version = "py310"
232+
# [[[end]]]
193233

194234
[tool.ruff.format]
195235
# Like Black, indent with spaces, rather than tabs.

src/django_github_app/_sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from __future__ import annotations
22

33
import functools
4+
from collections.abc import Callable
45
from collections.abc import Coroutine
56
from typing import Any
6-
from typing import Callable
77
from typing import ParamSpec
88
from typing import TypeVar
99

src/django_github_app/checks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def get_webhook_views():
1818
callback = pattern.callback
1919
view_class = getattr(callback, "view_class", None)
2020
if view_class:
21-
if issubclass(view_class, (AsyncWebhookView, SyncWebhookView)):
21+
if issubclass(view_class, AsyncWebhookView | SyncWebhookView):
2222
found_views.append(view_class)
2323

2424
return found_views

src/django_github_app/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def _parse_private_key(self, value: Any) -> str:
3939
if not value:
4040
return ""
4141

42-
if not isinstance(value, (str, Path)):
42+
if not isinstance(value, str | Path):
4343
return str(value)
4444

4545
if isinstance(value, str) and value.startswith("-----BEGIN"):

0 commit comments

Comments
 (0)