Skip to content

Commit

Permalink
Update django to 5.0.3 (#1990)
Browse files Browse the repository at this point in the history
* Update django to 5.0.3

Reference: https://github.com/django/django/blob/5.0.3/django/utils/text.py

CI failure: https://github.com/typeddjango/django-stubs/actions/runs/8150233247/job/22276149519?pr=1989

* [pre-commit.ci] auto fixes from pre-commit.com hooks

* Update requirements.txt

* Update text.pyi

* [pre-commit.ci] auto fixes from pre-commit.com hooks

* Create allowlist_django50.txt

* Delete scripts/stubtest/allowlist_django50.txt

* Update allowlist.txt

* Update text.pyi

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
sobolevn and pre-commit-ci[bot] authored Mar 5, 2024
1 parent 2be024b commit cb1b179
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
16 changes: 14 additions & 2 deletions django-stubs/utils/text.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from collections.abc import Callable, Iterable, Iterator
from io import BytesIO
from re import Pattern
from re import Match, Pattern
from typing import ClassVar, TypeVar, overload

from django.db.models.base import Model
Expand All @@ -11,7 +11,19 @@ _StrOrPromiseOrNoneT = TypeVar("_StrOrPromiseOrNoneT", bound=_StrOrPromise | Non

def capfirst(x: _StrOrPromiseOrNoneT) -> _StrOrPromiseOrNoneT: ...

re_words: Pattern[str]
re_notag: Pattern[str]
re_prt: Pattern[str]

class WordsRegex:
@staticmethod
def search(text: str, pos: int) -> Match | FakeMatch: ...

class FakeMatch:
def __init__(self, text: str, end: int) -> None: ...
def __getitem__(self, group: int) -> str | None: ...
def end(self, group: int = 0) -> int: ...

re_words: type[WordsRegex]
re_chars: Pattern[str]
re_tag: Pattern[str]
re_newlines: Pattern[str]
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pytest-shard==0.1.2
# Django deps:
psycopg2-binary
Django==4.2.7; python_version < '3.10'
Django==5.0.2; python_version >= '3.10'
Django==5.0.3; python_version >= '3.10'
-e ./ext
-e .[compatible-mypy]

Expand Down
3 changes: 2 additions & 1 deletion scripts/stubtest/allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ django.utils.http.ASCTIME_DATE
django.utils.http.ETAG_MATCH
django.utils.http.RFC1123_DATE
django.utils.http.RFC850_DATE
django.utils.text.re_words
django.utils.text.re_notag
django.utils.text.re_prt
django.utils.text.re_chars
django.utils.text.re_tag
django.utils.text.re_newlines
Expand Down

0 comments on commit cb1b179

Please sign in to comment.