drop support for Python 3.7

This commit is contained in:
David Lord 2024-04-23 12:09:23 -07:00
parent de6131232a
commit fcd3d3bbf3
No known key found for this signature in database
GPG Key ID: 7A1C87E3F5BC42A8
7 changed files with 7 additions and 42 deletions

View File

@ -28,7 +28,6 @@ jobs:
- {python: '3.10'}
- {python: '3.9'}
- {python: '3.8'}
- {python: '3.7'}
- {name: PyPy, python: 'pypy-3.10', tox: pypy310}
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2

View File

@ -5,6 +5,7 @@ Version 3.2.0
Unreleased
- Drop support for Python 3.7.
- Use modern packaging metadata with ``pyproject.toml`` instead of ``setup.cfg``.
:pr:`1793`
- Use ``flit_core`` instead of ``setuptools`` as build backend.

View File

@ -30,7 +30,7 @@ Installation
------------
We recommend using the latest version of Python. Jinja supports Python
3.7 and newer. We also recommend using a `virtual environment`_ in order
3.8 and newer. We also recommend using a `virtual environment`_ in order
to isolate your project dependencies from other projects and the system.
.. _virtual environment: https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments

View File

@ -15,7 +15,7 @@ classifiers = [
"Topic :: Text Processing :: Markup :: HTML",
"Typing :: Typed",
]
requires-python = ">=3.7"
requires-python = ">=3.8"
dependencies = ["MarkupSafe>=2.0"]
dynamic = ["version"]

View File

@ -118,26 +118,7 @@ def fake_traceback( # type: ignore
elif function.startswith("block_"):
location = f"block {function[6:]!r}"
if sys.version_info >= (3, 8):
code = code.replace(co_name=location)
else:
code = CodeType(
code.co_argcount,
code.co_kwonlyargcount,
code.co_nlocals,
code.co_stacksize,
code.co_flags,
code.co_code,
code.co_consts,
code.co_names,
code.co_varnames,
code.co_filename,
location,
code.co_firstlineno,
code.co_lnotab,
code.co_freevars,
code.co_cellvars,
)
code = code.replace(co_name=location)
# Execute the new code, which is guaranteed to raise, and return
# the new traceback without this frame.

View File

@ -289,28 +289,12 @@ class InternationalizationExtension(Extension):
import gettext
translations = gettext.NullTranslations()
if hasattr(translations, "pgettext"):
# Python < 3.8
pgettext = translations.pgettext
else:
def pgettext(c: str, s: str) -> str: # type: ignore[misc]
return s
if hasattr(translations, "npgettext"):
npgettext = translations.npgettext
else:
def npgettext(c: str, s: str, p: str, n: int) -> str: # type: ignore[misc]
return s if n == 1 else p
self._install_callables(
gettext=translations.gettext,
ngettext=translations.ngettext,
newstyle=newstyle,
pgettext=pgettext,
npgettext=npgettext,
pgettext=translations.pgettext,
npgettext=translations.npgettext,
)
def _install_callables(

View File

@ -1,6 +1,6 @@
[tox]
envlist =
py3{12,11,10,9,8,7}
py3{12,11,10,9,8}
pypy310
style
typing