Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .just/documentation.just
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ serve PORT="8000": cog
[no-cd]
[private]
cog:
uv run --extra docs cog -r docs/development/just.md
uv run --with cogapp cog -r CONTRIBUTING.md README.md pyproject.toml
6 changes: 0 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ repos:
additional_dependencies:
- black==22.12.0

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.14.0
hooks:
- id: pretty-format-toml
args: [--autofix]

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.24.1
hooks:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ and this project attempts to adhere to [Semantic Versioning](https://semver.org/

- Added support for Django 5.2.

### Removed

- Dropped support for Django 5.0.

### Fixed

- 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.
Expand Down
6 changes: 5 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,19 @@ $ # just --list --list-submodules

Available recipes:
bootstrap
coverage
coverage *ARGS
lint
lock *ARGS
manage *COMMAND
test *ARGS
testall *ARGS
types *ARGS
docs:
build LOCATION="docs/_build/html" # Build documentation using Sphinx
serve PORT="8000" # Serve documentation locally
project:
bump *ARGS
release *ARGS
```
<!-- [[[end]]] -->

Expand Down
28 changes: 23 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@

[![PyPI](https://img.shields.io/pypi/v/django-github-app)](https://pypi.org/project/django-github-app/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django-github-app)
![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)
<!-- https://shields.io/badges -->
<!-- django-4.2 | 5.0 | 5.1 | 5.2-#44B78B -->
<!-- labelColor=%23092E20 -->
<!-- [[[cog
import subprocess
import cog

from noxfile import DJ_VERSIONS
from noxfile import PY_VERSIONS

cog.outl(f"![Django Version](https://img.shields.io/badge/django-{'%20%7C%20'.join(DJ_VERSIONS)}-%2344B78B?labelColor=%23092E20)")
]]] -->
![Django Version](https://img.shields.io/badge/django-4.2%20%7C%205.1%20%7C%205.2%20%7C%20main-%2344B78B?labelColor=%23092E20)
<!-- [[[end]]] -->

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

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

## Requirements

<!-- [[[cog
import subprocess
import cog

from noxfile import DJ_VERSIONS
from noxfile import PY_VERSIONS

cog.outl(f"- Python {', '.join([version for version in PY_VERSIONS])}")
cog.outl(f"- Django {', '.join([version for version in DJ_VERSIONS if version != 'main'])}")
]]] -->
- Python 3.10, 3.11, 3.12, 3.13
- Django 4.2, 5.0, 5.1, 5.2
- Django 4.2, 5.1, 5.2
<!-- [[[end]]] -->

## Installation

Expand Down
7 changes: 1 addition & 6 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@
PY_LATEST = PY_VERSIONS[-1]

DJ42 = "4.2"
DJ50 = "5.0"
DJ51 = "5.1"
DJ52 = "5.2"
DJMAIN = "main"
DJMAIN_MIN_PY = PY312
DJ_VERSIONS = [DJ42, DJ50, DJ51, DJ52, DJMAIN]
DJ_VERSIONS = [DJ42, DJ51, DJ52, DJMAIN]
DJ_LTS = [
version for version in DJ_VERSIONS if version.endswith(".2") and version != DJMAIN
]
Expand Down Expand Up @@ -51,10 +50,6 @@ def should_skip(python: str, django: str) -> bool:
# Django 5.1 requires Python 3.10+
return True

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

return False


Expand Down
46 changes: 43 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,40 @@ authors = [
classifiers = [
"Development Status :: 4 - Beta",
"Framework :: Django",
# [[[cog
# import subprocess
# import cog
#
# from noxfile import DJ_VERSIONS
#
# for version in DJ_VERSIONS:
# if version == "main":
# continue
# cog.outl(f' "Framework :: Django :: {version}",')
# ]]] -->
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Framework :: Django :: 5.1",
"Framework :: Django :: 5.2",
# [[[end]]]
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
# [[[cog
# import subprocess
# import cog
#
# from noxfile import PY_VERSIONS
#
# for version in PY_VERSIONS:
# cog.outl(f' "Programming Language :: Python :: {version}",')
# ]]] -->
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
# [[[end]]]
"Programming Language :: Python :: Implementation :: CPython"
]
dependencies = [
Expand All @@ -61,7 +82,16 @@ dynamic = ["version"]
license = {file = "LICENSE"}
name = "django-github-app"
readme = "README.md"
# [[[cog
# import subprocess
# import cog
#
# from noxfile import PY_VERSIONS
#
# cog.outl(f'requires-python = ">={PY_VERSIONS[0]}"')
# ]]] -->
requires-python = ">=3.10"
# [[[end]]]

[project.urls]
Documentation = "https://github.com/joshuadavidthomas/django-github-app#README"
Expand Down Expand Up @@ -188,8 +218,18 @@ extend-include = ["*.pyi?"]
indent-width = 4
# Same as Black.
line-length = 88
# Assume Python >3.8
target-version = "py38"
# [[[cog
# import subprocess
# import cog
#
# from noxfile import PY_VERSIONS
#
# cog.outl(f"# Assume Python >{PY_VERSIONS[0]}")
# cog.outl(f'target-version = "py{PY_VERSIONS[0].replace(".", "")}"')
# ]]] -->
# Assume Python >3.10
target-version = "py310"
# [[[end]]]

[tool.ruff.format]
# Like Black, indent with spaces, rather than tabs.
Expand Down
2 changes: 1 addition & 1 deletion src/django_github_app/_sync.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from __future__ import annotations

import functools
from collections.abc import Callable
from collections.abc import Coroutine
from typing import Any
from typing import Callable
from typing import ParamSpec
from typing import TypeVar

Expand Down
2 changes: 1 addition & 1 deletion src/django_github_app/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def get_webhook_views():
callback = pattern.callback
view_class = getattr(callback, "view_class", None)
if view_class:
if issubclass(view_class, (AsyncWebhookView, SyncWebhookView)):
if issubclass(view_class, AsyncWebhookView | SyncWebhookView):
found_views.append(view_class)

return found_views
Expand Down
2 changes: 1 addition & 1 deletion src/django_github_app/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _parse_private_key(self, value: Any) -> str:
if not value:
return ""

if not isinstance(value, (str, Path)):
if not isinstance(value, str | Path):
return str(value)

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