Skip to content
Myr

deprecate `__version__` (#2098)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by GitHub · parents dfe82ad, b7ce542 · Browse files · 4 files+24 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+24 added−2 removed

  • other:+24 added−2 removed

4 files+24 added−2 removed

modified:src/jinja2/__init__.py+20 added-1 removed
1 unmodified line
2non-XML syntax that supports inline expressions and an optional3sandboxed environment.4"""56from __future__ import annotations78import typing as t910from .bccache import BytecodeCache as BytecodeCache11from .bccache import FileSystemBytecodeCache as FileSystemBytecodeCache12from .bccache import MemcachedBytecodeCache as MemcachedBytecodeCache13from .environment import Environment as Environment
24 unmodified lines
38from .utils import pass_environment as pass_environment39from .utils import pass_eval_context as pass_eval_context40from .utils import select_autoescape as select_autoescape4138__version__ = "3.2.0.dev0"4243def __getattr__(name: str) -> t.Any:44 if name == "__version__":45 import importlib.metadata46 import warnings4748 warnings.warn(49 "The `__version__` attribute is deprecated and will be removed in"50 " Werkzeug 3.3. Use feature detection or"51 ' `importlib.metadata.version("werkzeug")` instead.',52 DeprecationWarning,53 stacklevel=2,54 )55 return importlib.metadata.version("werkzeug")5657 raise AttributeError(name)
modified:CHANGES.rst+2 added
6 unmodified lines
78- Drop support for Python 3.7, 3.8, and 3.9.9- Update minimum MarkupSafe version to >= 3.0.10- Update minimum Babel version to >= 2.17.11- Deprecate the ``__version__`` attribute. Use feature detection or12 ``importlib.metadata.version("jinja2")`` instead.13- Use modern packaging metadata with ``pyproject.toml`` instead of ``setup.cfg``.14 :pr:`1793`15- Use ``flit_core`` instead of ``setuptools`` as build backend.16
1056 unmodified lines
modified:pyproject.toml+1 added-1 removed
1[project]2name = "Jinja2"3version = "3.2.0.dev"4description = "A very fast and expressive template engine."5readme = "README.md"6license = "BSD-3-Clause"7license-files = ["LICENSE.txt"]
9 unmodified lines
17 "Typing :: Typed",18]19requires-python = ">=3.10"20dependencies = ["MarkupSafe>=3.0"]20dynamic = ["version"]2122[project.urls]23Donate = "https://palletsprojects.com/donate"24Documentation = "https://jinja.palletsprojects.com/"
187 unmodified lines
modified:uv.lock+1 added
311 unmodified lines
312]313314[[package]]315name = "jinja2"316version = "3.2.0.dev0"317source = { editable = "." }318dependencies = [319 { name = "markupsafe" },320]
924 unmodified lines