Skip to content

Commit 94f84e3

Browse files
committed
- 1.4.0
1 parent c31d8cf commit 94f84e3

10 files changed

Lines changed: 106 additions & 98 deletions

File tree

‎doc/build/changelog.rst‎

Lines changed: 104 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,110 @@ Changelog
88

99
.. changelog::
1010
:version: 1.4.0
11-
:include_notes_from: unreleased
11+
:released: Tue Aug 4 2026
12+
13+
.. change::
14+
:tags: bug, ext
15+
:tickets: 393
16+
17+
The minimum Lingua version supported by :class:`.LinguaMakoExtractor` is
18+
now 4.16. The test suite had continued to pin Lingua below 4 long after
19+
the extractor itself was repaired to work with Lingua 4 in version 1.2.0,
20+
with the result that the plugin was no longer covered by tests at all; the
21+
pinned version additionally imports ``pkg_resources`` at startup, which is
22+
not present in current setuptools releases and left the package
23+
unimportable. Lingua 4.16 resolves entry points using
24+
``importlib.metadata``, so no deprecated ``pkg_resources`` usage remains.
25+
26+
.. change::
27+
:tags: bug, exceptions
28+
:tickets: 437
29+
30+
Fixed issue where formatting a traceback for an exception raised inside a
31+
template compiled from a string would emit ``DeprecationWarning: Module
32+
globals is missing a __spec__.loader`` on Python 3.15. Modules for such
33+
templates were created without a module spec, which Python's
34+
:mod:`linecache` module consults for every frame while a traceback is
35+
being built; the warning was raised from within traceback formatting
36+
itself, disrupting the error report for applications that configure
37+
warnings as errors. These modules are now given a spec with a loader that
38+
provides the generated module source, which additionally allows the
39+
generated source lines to be displayed in tracebacks produced by the
40+
standard library where previously no source was available.
41+
42+
.. change::
43+
:tags: changed, examples
44+
45+
The ``examples/bench`` folder has been removed as it used mostly
46+
long-obsolete template engines. The ``examples/wsgi/run_wsgi.py`` example
47+
has been updated to remove the use of the removed-in-Python-3.13 ``cgi``
48+
module, and to be runnable as a module from the project root.
49+
50+
.. change::
51+
:tags: bug, exceptions
52+
:tickets: 430, 245, 428
53+
54+
A series of fixes involving syntax warnings and exceptions found
55+
during template lexing / compilation:
56+
57+
* Warnings raised while a template is compiled, which in practice means
58+
``SyntaxWarning``, now report the filename and line number of the
59+
template rather than a line within the generated module, and are no
60+
longer reported twice. This applies equally to templates compiled from a
61+
string, from a file, and to a module file in a
62+
:paramref:`.Template.module_directory`, as does a warning raised while
63+
the module level code of a ``<%! %>`` block runs. Warnings raised while
64+
a template renders continue to report the location within the generated
65+
module.
66+
67+
To do this, Mako replaces ``warnings.showwarning`` while a template is
68+
compiled. As that name is global to the process, an unrelated warning
69+
displayed by another thread during that window may also be passed through
70+
Mako's hook, which shows any warning it does not recognize unchanged.
71+
(:ticket:`430`)
72+
73+
* The ``SyntaxException`` raised for a syntax error in Python code spanning
74+
several lines of a template, such as that within a ``<% %>`` or ``<%! %>``
75+
block, is now reported against the line the error is on, rather than
76+
against the line on which the block begins. The line reported for code
77+
that occupies a single line, such as an expression or a control line, is
78+
unchanged. (:ticket:`245`)
79+
80+
* The ``SyntaxException`` raised for a tag or expression that is never
81+
closed is now reported against the line the construct begins on, rather
82+
than the point at which the search for the closing token gave up, which
83+
for an unclosed construct is the end of the template. The message of the
84+
exception is amended to indicate that the position given is where the
85+
unterminated construct begins. (:ticket:`428`)
86+
87+
88+
89+
90+
.. change::
91+
:tags: changed, installation
92+
93+
Minimum MarkupSafe dependency version bumped from 0.9.2 to 2.0.
94+
95+
.. change::
96+
:tags: changed, tests
97+
98+
The test suite now runs via nox. The old tox.ini remains however nox will
99+
be the only system that's maintained.
100+
101+
.. change::
102+
:tags: changed, installation
103+
104+
Project metadata has been migrated to :pep:`621` ``pyproject.toml``-based
105+
configuration. ``setup.cfg`` remains only for the ``[mako_testing]``
106+
section used by Mako's own test suite. The build requirements
107+
now set the minimum setuptools version at 77.0.0 in order to build Mako
108+
from source.
109+
110+
.. change::
111+
:tags: changed, installation
112+
113+
Minimum Python version is now 3.10. Mako 1.4.0 has been tested up through
114+
Python 3.15.0b4.
12115

13116
1.3
14117
===

‎doc/build/conf.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@
8888
# The short X.Y version.
8989
version = mako.__version__
9090
# The full version, including alpha/beta/rc tags.
91-
release = "1.3.12"
92-
release_date = "Tue Apr 28 2026"
91+
release = "1.4.0"
92+
release_date = "Tue Aug 4 2026"
9393
# The language for content autogenerated by Sphinx. Refer to documentation
9494
# for a list of supported languages.
9595
# language = None

‎doc/build/unreleased/393.rst‎

Lines changed: 0 additions & 12 deletions
This file was deleted.

‎doc/build/unreleased/437.rst‎

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎doc/build/unreleased/examples.rst‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

‎doc/build/unreleased/exception_fixes.rst‎

Lines changed: 0 additions & 39 deletions
This file was deleted.

‎doc/build/unreleased/markupsafe.rst‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎doc/build/unreleased/nox.rst‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎doc/build/unreleased/pep621.rst‎

Lines changed: 0 additions & 8 deletions
This file was deleted.

‎doc/build/unreleased/py310.rst‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)