- {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
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.
------------
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
"Topic :: Text Processing :: Markup :: HTML",
"Typing :: Typed",
]
-requires-python = ">=3.7"
+requires-python = ">=3.8"
dependencies = ["MarkupSafe>=2.0"]
dynamic = ["version"]
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.
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(
[tox]
envlist =
- py3{12,11,10,9,8,7}
+ py3{12,11,10,9,8}
pypy310
style
typing