Skip to content

Commit

Permalink
test with python 3.13 (#2900)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism committed May 11, 2024
2 parents 1565490 + e123626 commit 69dc333
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 14 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Expand Up @@ -21,6 +21,7 @@ jobs:
fail-fast: false
matrix:
include:
- {python: '3.13'}
- {python: '3.12'}
- {name: Windows, python: '3.12', os: windows-latest}
- {name: Mac, python: '3.12', os: macos-latest}
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Expand Up @@ -79,9 +79,6 @@ strict = true
module = [
"colorama.*",
"cryptography.*",
"eventlet.*",
"gevent.*",
"greenlet.*",
"watchdog.*",
"xprocess.*",
]
Expand Down
4 changes: 1 addition & 3 deletions requirements/dev.txt
Expand Up @@ -18,7 +18,7 @@ certifi==2024.2.2
# via
# -r docs.txt
# requests
cffi==1.16.0
cffi @ https://github.com/python-cffi/cffi/archive/d7f750b1b1c5ea4da5aa537b9baba0e01b0ce843.zip
# via
# -r tests.txt
# cryptography
Expand Down Expand Up @@ -46,8 +46,6 @@ filelock==3.13.3
# via
# tox
# virtualenv
greenlet==3.0.3
# via -r tests.txt
identify==2.5.35
# via pre-commit
idna==3.6
Expand Down
3 changes: 2 additions & 1 deletion requirements/tests.in
Expand Up @@ -3,6 +3,7 @@ pytest-timeout
# pinned for python 3.8 support
pytest-xprocess<1
cryptography
greenlet
watchdog
ephemeral-port-reserve
# pin current commit on main for python 3.13 support
https://github.com/python-cffi/cffi/archive/d7f750b1b1c5ea4da5aa537b9baba0e01b0ce843.zip
8 changes: 4 additions & 4 deletions requirements/tests.txt
Expand Up @@ -4,14 +4,14 @@
#
# pip-compile tests.in
#
cffi==1.16.0
# via cryptography
cffi @ https://github.com/python-cffi/cffi/archive/d7f750b1b1c5ea4da5aa537b9baba0e01b0ce843.zip
# via
# -r tests.in
# cryptography
cryptography==42.0.5
# via -r tests.in
ephemeral-port-reserve==1.1.4
# via -r tests.in
greenlet==3.0.3
# via -r tests.in
iniconfig==2.0.0
# via pytest
packaging==24.0
Expand Down
15 changes: 13 additions & 2 deletions src/werkzeug/debug/tbtools.py
Expand Up @@ -296,7 +296,12 @@ def render_traceback_html(self, include_title: bool = True) -> str:

rows.append("\n".join(row_parts))

is_syntax_error = issubclass(self._te.exc_type, SyntaxError)
if sys.version_info < (3, 13):
exc_type_str = self._te.exc_type.__name__
else:
exc_type_str = self._te.exc_type_str

is_syntax_error = exc_type_str == "SyntaxError"

if include_title:
if is_syntax_error:
Expand Down Expand Up @@ -325,13 +330,19 @@ def render_debugger_html(
) -> str:
exc_lines = list(self._te.format_exception_only())
plaintext = "".join(self._te.format())

if sys.version_info < (3, 13):
exc_type_str = self._te.exc_type.__name__
else:
exc_type_str = self._te.exc_type_str

return PAGE_HTML % {
"evalex": "true" if evalex else "false",
"evalex_trusted": "true" if evalex_trusted else "false",
"console": "false",
"title": escape(exc_lines[0]),
"exception": escape("".join(exc_lines)),
"exception_type": escape(self._te.exc_type.__name__),
"exception_type": escape(exc_type_str),
"summary": self.render_traceback_html(include_title=False),
"plaintext": escape(plaintext),
"plaintext_cs": re.sub("-{2,}", "-", plaintext),
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
@@ -1,6 +1,6 @@
[tox]
envlist =
py3{12,11,10,9,8}
py3{13,12,11,10,9,8}
pypy310
style
typing
Expand Down

0 comments on commit 69dc333

Please sign in to comment.