<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/mako.git/test, branch master</title>
<subtitle>github.com: sqlalchemy/mako.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/mako.git/'/>
<entry>
<title>dont intefere with mako.templates in the test suite</title>
<updated>2021-08-19T15:00:19+00:00</updated>
<author>
<name>Mike Bayer</name>
<email>mike_mp@zzzcomputing.com</email>
</author>
<published>2021-08-19T15:00:19+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/mako.git/commit/?id=0e610d6e688e2cedbdbf27771b6a99aebe5b80bd'/>
<id>0e610d6e688e2cedbdbf27771b6a99aebe5b80bd</id>
<content type='text'>
Fixed some issues with running the test suite which would be revealed by
running tests in random order.

Fixes: #338
Change-Id: I90c2a86f9279a265f64b75be3a7af314ab8772ba
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixed some issues with running the test suite which would be revealed by
running tests in random order.

Fixes: #338
Change-Id: I90c2a86f9279a265f64b75be3a7af314ab8772ba
</pre>
</div>
</content>
</entry>
<entry>
<title>Avoid warnings under Python 3.10</title>
<updated>2021-01-14T18:13:04+00:00</updated>
<author>
<name>Petr Viktorin</name>
<email>pviktori@redhat.com</email>
</author>
<published>2021-01-14T13:56:59+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/mako.git/commit/?id=92700475248c72f2c3a6e427f754e582a2b575fb'/>
<id>92700475248c72f2c3a6e427f754e582a2b575fb</id>
<content type='text'>
Fixed Python deprecation issues related to module importing, as well as
file access within the Lingua plugin, for deprecated APIs that began to
emit warnings under Python 3.10.  Pull request courtesy Petr Viktorin.

This modernizes the code to avoid `DeprecationWarning` and `ResourceWarning` encountered in the test suite under Python 3.10a4:
- [load_module](https://docs.python.org/3/library/importlib.html#importlib.abc.Loader.load_module) is deprecated
- Some files weren't being closed

This changes the semantics of the `compat.load_module` function: on Python 3.5+, the module is no longer inserted in `sys.modules`. All non-test calls did `del sys.modules[self.module_id]` right after the call, anyway. On older Python, the module is inserted and then deleted.

(Some additional `DeprecationWarning` come from Setuptools: https://github.com/pypa/setuptools/pull/2517)

Closes: #328
Pull-request: https://github.com/sqlalchemy/mako/pull/328
Pull-request-sha: 87c1d09e5f39de7b19e749568c437928580f7553

Change-Id: I9cb3772f6812ef14297792344caf2f9aa5337adf
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixed Python deprecation issues related to module importing, as well as
file access within the Lingua plugin, for deprecated APIs that began to
emit warnings under Python 3.10.  Pull request courtesy Petr Viktorin.

This modernizes the code to avoid `DeprecationWarning` and `ResourceWarning` encountered in the test suite under Python 3.10a4:
- [load_module](https://docs.python.org/3/library/importlib.html#importlib.abc.Loader.load_module) is deprecated
- Some files weren't being closed

This changes the semantics of the `compat.load_module` function: on Python 3.5+, the module is no longer inserted in `sys.modules`. All non-test calls did `del sys.modules[self.module_id]` right after the call, anyway. On older Python, the module is inserted and then deleted.

(Some additional `DeprecationWarning` come from Setuptools: https://github.com/pypa/setuptools/pull/2517)

Closes: #328
Pull-request: https://github.com/sqlalchemy/mako/pull/328
Pull-request-sha: 87c1d09e5f39de7b19e749568c437928580f7553

Change-Id: I9cb3772f6812ef14297792344caf2f9aa5337adf
</pre>
</div>
</content>
</entry>
<entry>
<title>Switch template encoding to utf-8</title>
<updated>2020-05-29T20:25:11+00:00</updated>
<author>
<name>Mike Bayer</name>
<email>mike_mp@zzzcomputing.com</email>
</author>
<published>2020-05-29T20:25:11+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/mako.git/commit/?id=68b74a1bf581433b59bfb1656b654018607c092d'/>
<id>68b74a1bf581433b59bfb1656b654018607c092d</id>
<content type='text'>
The default template encoding is now utf-8.  Previously, the encoding was
"ascii", which was standard throughout Python 2.   This allows that
"magic encoding comment" for utf-8 templates is no longer required.

Fixes: #267
Change-Id: I411a75ebd6161e2517e06b5180a3571e5f5d923e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The default template encoding is now utf-8.  Previously, the encoding was
"ascii", which was standard throughout Python 2.   This allows that
"magic encoding comment" for utf-8 templates is no longer required.

Fixes: #267
Change-Id: I411a75ebd6161e2517e06b5180a3571e5f5d923e
</pre>
</div>
</content>
</entry>
<entry>
<title>Use unittest.SkipTest (again?)</title>
<updated>2020-03-02T19:00:45+00:00</updated>
<author>
<name>Michał Górny</name>
<email>mgorny@gentoo.org</email>
</author>
<published>2020-03-02T19:00:45+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/mako.git/commit/?id=6a13e22e7131fd6792dae4cb5b3ab97dcae4a4cd'/>
<id>6a13e22e7131fd6792dae4cb5b3ab97dcae4a4cd</id>
<content type='text'>
While I can believe that the standard exception might not have worked
with some ancient version of pytest, it certainly works just fine now.
This saves people from importing nose which kills pytest
via DeprecationWarnings these days.

Closes: #316
Pull-request: https://github.com/sqlalchemy/mako/pull/316
Pull-request-sha: 90dfcfc3d0351ab9bf8125e8c2adb45c57059a6d

Change-Id: Ie816acd325c6783e08801bc83de37dbe6b4581e5
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While I can believe that the standard exception might not have worked
with some ancient version of pytest, it certainly works just fine now.
This saves people from importing nose which kills pytest
via DeprecationWarnings these days.

Closes: #316
Pull-request: https://github.com/sqlalchemy/mako/pull/316
Pull-request-sha: 90dfcfc3d0351ab9bf8125e8c2adb45c57059a6d

Change-Id: Ie816acd325c6783e08801bc83de37dbe6b4581e5
</pre>
</div>
</content>
</entry>
<entry>
<title>Replace usage of parser.suite with ast.parse</title>
<updated>2020-01-06T02:18:15+00:00</updated>
<author>
<name>Mike Bayer</name>
<email>mike_mp@zzzcomputing.com</email>
</author>
<published>2020-01-06T02:11:07+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/mako.git/commit/?id=2dae7d2c3da73653e6de329dc15c55056a0b9ab6'/>
<id>2dae7d2c3da73653e6de329dc15c55056a0b9ab6</id>
<content type='text'>
Replaced usage of the long-superseded "parser.suite" module in the
mako.util package for parsing the python magic encoding comment with the
"ast.parse" function introduced many years ago in Python 2.5, as
"parser.suite" is emitting deprecation warnings in Python 3.9.

Additionally repair two error-detection unit tests that were using a
"print" statement despite the tests running under Python 3; while the
tests were passing they were no longer testing the right thing.

Fixes: #310
Change-Id: Id436e2c6620438ef16b3f188b989233c82972b29
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replaced usage of the long-superseded "parser.suite" module in the
mako.util package for parsing the python magic encoding comment with the
"ast.parse" function introduced many years ago in Python 2.5, as
"parser.suite" is emitting deprecation warnings in Python 3.9.

Additionally repair two error-detection unit tests that were using a
"print" statement despite the tests running under Python 3; while the
tests were passing they were no longer testing the right thing.

Fixes: #310
Change-Id: Id436e2c6620438ef16b3f188b989233c82972b29
</pre>
</div>
</content>
</entry>
<entry>
<title>Bump Python versions, remove conditional imports</title>
<updated>2019-07-27T16:34:21+00:00</updated>
<author>
<name>Mike Bayer</name>
<email>mike_mp@zzzcomputing.com</email>
</author>
<published>2019-07-27T16:01:10+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/mako.git/commit/?id=338cad687a1f49b021e81d33fd16847a4c5c7731'/>
<id>338cad687a1f49b021e81d33fd16847a4c5c7731</id>
<content type='text'>
Mako 1.1 now supports Python versions:

* 2.7
* 3.4 and higher

This includes that setup.py no longer includes any conditionals, allowing
for a pure Python wheel build, however this is not necessarily part of the
Pypi release process as of yet.  The test suite also raises for Python
deprecation warnings.

Fixes: #249

Replaced usage of ``inspect.getfullargspec()`` with the vendored version
used by SQLAlchemy, Alembic to avoid future deprecation warnings.  Also
cleans up an additional version of the same function that's apparently
been floating around for some time.

Fixes: #295
Change-Id: I98274c16b6022289d1890f4daf532bab323ab112
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Mako 1.1 now supports Python versions:

* 2.7
* 3.4 and higher

This includes that setup.py no longer includes any conditionals, allowing
for a pure Python wheel build, however this is not necessarily part of the
Pypi release process as of yet.  The test suite also raises for Python
deprecation warnings.

Fixes: #249

Replaced usage of ``inspect.getfullargspec()`` with the vendored version
used by SQLAlchemy, Alembic to avoid future deprecation warnings.  Also
cleans up an additional version of the same function that's apparently
been floating around for some time.

Fixes: #295
Change-Id: I98274c16b6022289d1890f4daf532bab323ab112
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge "Include URI in traceback if filename is unknown"</title>
<updated>2019-07-08T16:36:03+00:00</updated>
<author>
<name>mike bayer</name>
<email>mike_mp@zzzcomputing.com</email>
</author>
<published>2019-07-08T16:36:03+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/mako.git/commit/?id=4663af342bf76a736df36a3ca96e7f974d0e2fef'/>
<id>4663af342bf76a736df36a3ca96e7f974d0e2fef</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Support n filter in the page tag</title>
<updated>2019-07-08T15:25:00+00:00</updated>
<author>
<name>Martin von Gagern</name>
<email>gagern@google.com</email>
</author>
<published>2019-07-04T13:37:20+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/mako.git/commit/?id=c0697963498a934a6323b8e04adf1a92aad25620'/>
<id>c0697963498a934a6323b8e04adf1a92aad25620</id>
<content type='text'>
In some situations, it is inconvenient to pass default_filters in the
Template constructor depending on the template in question.  It might be
easier in such situations to express page filters in the template itself.
However, dropping the existing default_filters (either explicitly set or the
default of ["str"] resp. ["unicode"]) might break existing templates.

The code change here comes to the rescue in such situations.  Existing
templates keep working as they are, but editors of templates get a tool to
replace the default filters for specific templates.  They do take on the
responsibility of turning all encountered inputs into strings, lest they
fail along the lines of https://github.com/sqlalchemy/mako/issues/272.

This change should be sufficiently backwards compatible to not cause any
concerns.  Sure, technically a "n" filter at page tag level was treated as a
no-op so far.  So theoretically existing templates could break.  But there
was no incentive to have such an "n" filter at the page tag level, and the
expressed semantics of the "n" filter is to suppress default filters, so
semantically anyone relying on it being a no-op in that situation was using
unsupported hacks anyway.

Closes: #299
Pull-request: https://github.com/sqlalchemy/mako/pull/299
Pull-request-sha: f8d5a22db3230634d2b42c59909985f31875a9f5

Change-Id: Ide030975229c1df7c0cef534976f740a03c17ca6
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In some situations, it is inconvenient to pass default_filters in the
Template constructor depending on the template in question.  It might be
easier in such situations to express page filters in the template itself.
However, dropping the existing default_filters (either explicitly set or the
default of ["str"] resp. ["unicode"]) might break existing templates.

The code change here comes to the rescue in such situations.  Existing
templates keep working as they are, but editors of templates get a tool to
replace the default filters for specific templates.  They do take on the
responsibility of turning all encountered inputs into strings, lest they
fail along the lines of https://github.com/sqlalchemy/mako/issues/272.

This change should be sufficiently backwards compatible to not cause any
concerns.  Sure, technically a "n" filter at page tag level was treated as a
no-op so far.  So theoretically existing templates could break.  But there
was no incentive to have such an "n" filter at the page tag level, and the
expressed semantics of the "n" filter is to suppress default filters, so
semantically anyone relying on it being a no-op in that situation was using
unsupported hacks anyway.

Closes: #299
Pull-request: https://github.com/sqlalchemy/mako/pull/299
Pull-request-sha: f8d5a22db3230634d2b42c59909985f31875a9f5

Change-Id: Ide030975229c1df7c0cef534976f740a03c17ca6
</pre>
</div>
</content>
</entry>
<entry>
<title>Include URI in traceback if filename is unknown</title>
<updated>2019-07-08T15:20:30+00:00</updated>
<author>
<name>Martin von Gagern</name>
<email>gagern@google.com</email>
</author>
<published>2019-07-02T21:10:23+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/mako.git/commit/?id=65f8a3b715e8519ca5ca5d835240fe45aa4b96fa'/>
<id>65f8a3b715e8519ca5ca5d835240fe45aa4b96fa</id>
<content type='text'>
Using URIs as entrered will make the stack trace arguably more readable than
using the module name which is the URI with non-word characters replaced by
underscores.

This change also fixes a mistake where a mods cache hit would not update
template_filename, causing a stale filename to be displayed if the stack
trace alternates between different templates.  There now is a test case for
this.

Closes: #298
Pull-request: https://github.com/sqlalchemy/mako/pull/298
Pull-request-sha: ea35208d504932561711cdb574ec1f7def1e7060

Change-Id: Ieb606f6b6b7f4602d4d56694dd0bccf6dc287d20
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Using URIs as entrered will make the stack trace arguably more readable than
using the module name which is the URI with non-word characters replaced by
underscores.

This change also fixes a mistake where a mods cache hit would not update
template_filename, causing a stale filename to be displayed if the stack
trace alternates between different templates.  There now is a test case for
this.

Closes: #298
Pull-request: https://github.com/sqlalchemy/mako/pull/298
Pull-request-sha: ea35208d504932561711cdb574ec1f7def1e7060

Change-Id: Ieb606f6b6b7f4602d4d56694dd0bccf6dc287d20
</pre>
</div>
</content>
</entry>
<entry>
<title>Correctly track line numbers for multi-line code blocks</title>
<updated>2019-07-01T19:14:41+00:00</updated>
<author>
<name>Martin von Gagern</name>
<email>gagern@google.com</email>
</author>
<published>2019-07-01T18:35:54+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/mako.git/commit/?id=06d67cf4677e10e5c42581c02f293101e1c39a3a'/>
<id>06d67cf4677e10e5c42581c02f293101e1c39a3a</id>
<content type='text'>
Improved the line-number tracking for source lines inside of Python  ``&lt;%
... %&gt;`` blocks, such that text- and HTML-formatted exception traces such
as that of  :func:`.html_error_template` now report the correct source line
inside the block, rather than the first line of the block itself.
Exceptions in ``&lt;%! ... %&gt;`` blocks which get raised while loading the
module are still not reported correctly, as these are handled before the
Mako code is generated.  Pull request courtesy Martin von Gagern.

Closes: #297
Pull-request: https://github.com/sqlalchemy/mako/pull/297
Pull-request-sha: 60ad749604f8de0a9b8133430995045a93d0939c

Change-Id: I2086e4370e8e2db7099de01743840286f0160efc
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Improved the line-number tracking for source lines inside of Python  ``&lt;%
... %&gt;`` blocks, such that text- and HTML-formatted exception traces such
as that of  :func:`.html_error_template` now report the correct source line
inside the block, rather than the first line of the block itself.
Exceptions in ``&lt;%! ... %&gt;`` blocks which get raised while loading the
module are still not reported correctly, as these are handled before the
Mako code is generated.  Pull request courtesy Martin von Gagern.

Closes: #297
Pull-request: https://github.com/sqlalchemy/mako/pull/297
Pull-request-sha: 60ad749604f8de0a9b8133430995045a93d0939c

Change-Id: I2086e4370e8e2db7099de01743840286f0160efc
</pre>
</div>
</content>
</entry>
</feed>
