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
3 changes: 0 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ jobs:
matrix:
python-version: ['3.10', '3.14']
django-version: ['4.2', '5.1']
include:
- python-version: '3.9'
django-version: '4.2'
steps:
- uses: actions/checkout@v4

Expand Down
8 changes: 8 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@

- _Add your latest changes from PRs here_

### Breaking changes

- Drop support for Python 3.9; the new minimum is Python 3.10 (#443)

See also:
- [Python 3.9 EOL timeline](https://devguide.python.org/versions/#:~:text=Release%20manager-,3.9,-PEP%20596)
- [PEP 596](https://peps.python.org/pep-0596/)

### Development

- Add Python 3.14 to test matrix (#442)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ DJANGO_DOCUTILS_LIB_TEXT = {

## More information

- Python 3.9+
- Python 3.10+
- Django 4.2+

[![Docs](https://github.com/tony/django-docutils/workflows/docs/badge.svg)](https://github.com/tony/django-docutils/actions?query=workflow%3A%22Docs%22)
Expand Down
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "django-docutils"
version = "0.28.0"
description = "Docutils (a.k.a. reStructuredText, reST, RST) support for django."
requires-python = ">=3.9,<4.0"
requires-python = ">=3.10,<4.0"
authors = [
{name = "Tony Narlock", email = "tony@git-pull.com"}
]
Expand All @@ -18,7 +18,6 @@ classifiers = [
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
Expand Down Expand Up @@ -134,7 +133,7 @@ build-backend = "hatchling.build"
[tool.mypy]
strict = true
plugins = ["mypy_django_plugin.main"]
python_version = "3.9"
python_version = "3.10"
files = [
"src/",
"tests/",
Expand Down Expand Up @@ -186,7 +185,7 @@ disable_error_code = [
]

[tool.ruff]
target-version = "py39"
target-version = "py310"

[tool.ruff.lint]
select = [
Expand Down
3 changes: 1 addition & 2 deletions src/django_docutils/_internal/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@

if t.TYPE_CHECKING:
from os import PathLike

from typing_extensions import TypeAlias
from typing import TypeAlias

StrPath: TypeAlias = t.Union[str, "PathLike[str]"] # stable
""":class:`os.PathLike` or :class:`str`"""
Expand Down
2 changes: 1 addition & 1 deletion src/django_docutils/lib/roles/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from __future__ import annotations

import typing as t
from typing import Protocol

from docutils import nodes
from typing_extensions import Protocol


class UrlHandlerFn(Protocol):
Expand Down
2 changes: 1 addition & 1 deletion src/django_docutils/lib/transforms/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from pygments.token import _TokenType

TokenStream = Iterator[tuple[_TokenType, str]]
TokenGenerator = Iterator[tuple[t.Union[str, int], str]]
TokenGenerator = Iterator[tuple[str | int, str]]


class InlineHtmlFormatter(HtmlFormatter): # type:ignore
Expand Down
26 changes: 13 additions & 13 deletions src/django_docutils/lib/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@

from __future__ import annotations

from typing_extensions import NotRequired, TypedDict
from typing import TypedDict


class DjangoDocutilsLibRSTRolesSettings(TypedDict):
class DjangoDocutilsLibRSTRolesSettings(TypedDict, total=False):
"""Docutils role mappings."""

local: NotRequired[dict[str, str]]
local: dict[str, str]


class DjangoDocutilsLibRSTDocutilsSettings(TypedDict):
class DjangoDocutilsLibRSTDocutilsSettings(TypedDict, total=False):
"""Docutils document settings."""

raw_enabled: NotRequired[bool]
strip_comments: NotRequired[bool]
initial_header_level: NotRequired[int]
raw_enabled: bool
strip_comments: bool
initial_header_level: int


class DjangoDocutilsLibRSTSettings(TypedDict):
class DjangoDocutilsLibRSTSettings(TypedDict, total=False):
"""Core settings object for ``DJANGO_DOCUTILS_LIB_RST``."""

metadata_processors: NotRequired[list[str]]
transforms: NotRequired[list[str]]
docutils: NotRequired[DjangoDocutilsLibRSTDocutilsSettings]
directives: NotRequired[dict[str, str]]
roles: NotRequired[DjangoDocutilsLibRSTRolesSettings]
metadata_processors: list[str]
transforms: list[str]
docutils: DjangoDocutilsLibRSTDocutilsSettings
directives: dict[str, str]
roles: DjangoDocutilsLibRSTRolesSettings


class DjangoDocutilsLibTextSettings(TypedDict):
Expand Down
682 changes: 80 additions & 602 deletions uv.lock

Large diffs are not rendered by default.