Commit Graph

31 Commits

Author SHA1 Message Date
David Lord
aaa083d265
separate messages, add test 2024-12-19 20:15:10 -08:00
David Lord
227edfd372
clean up message, add test 2024-12-19 19:34:34 -08:00
Thomas Grainger
679af7f816
fix test_package_zip_list on 3.13 2024-05-13 20:04:38 +01:00
David Lord
004476c22b
test on python 3.13
update dev dependencies
refactor update tox envs
3.7 requires an old version of trio

xfail zip loader template test
2024-05-13 08:40:44 -07:00
David Lord
3fadee01b7
update dependencies 2022-12-29 10:39:00 -08:00
David Lord
1b02fccaf4
normpath on final template filename 2022-03-25 15:23:00 -07:00
David Lord
040088a395
use posixpath.join when loading template names 2022-03-15 13:58:22 -07:00
David Lord
eec0db8642
PackageLoader works with single module file 2021-11-09 12:18:53 -08:00
David Lord
8931077058
omit curdir from PackageLoader root path
fixes compatibility with zip imports

Co-authored-by: kuepe-sl <peter_kueffner@web.de>
2021-10-04 17:39:39 -07:00
Danny Sepler
06c646df2d
Use pathlib in some test places 2021-05-18 10:30:11 -07:00
David Lord
c0675781a5
add changelog and cleanup for pep 451 support 2020-03-30 12:55:40 -07:00
Anthony Sottile
a524e77eec
Use importlib machinery to fix PEP 451 import hooks 2020-03-30 11:41:34 -07:00
David Lord
e08dadd220
Merge branch '2.11.x' 2020-02-05 20:39:04 -08:00
David Lord
dd5a0508c5
remove custom pytest marks 2020-02-05 20:23:47 -08:00
David Lord
2a8515d2e5
apply pyupgrade and f-strings 2020-02-05 08:44:15 -08:00
David Lord
148a19138c
remove _compat module 2020-02-05 08:37:40 -08:00
David Lord
b0015c72d5
remove deprecated code 2020-02-05 08:37:40 -08:00
David Lord
4a59ac9514
Revert "rename imports to jinja"
This reverts commit 1167525b73.
2020-01-26 21:12:52 -08:00
David Lord
1167525b73
rename imports to jinja 2020-01-10 15:30:16 -08:00
David Lord
51c1c8efa6
simplify module docstrings 2020-01-10 13:42:02 -08:00
David Lord
bb6216ea30
apply flake8 2020-01-10 10:40:52 -08:00
David Lord
04c8787155
apply black 2020-01-10 07:54:39 -08:00
David Lord
d177eeb295
apply reorder-python-imports 2020-01-10 07:54:39 -08:00
Alex Chan
12307960dc
support pathlib in FileSystemLoader and ModuleLoader 2019-10-21 06:13:58 -07:00
David Lord
4b6077a8c0
PackageLoader doesn't depend on setuptools 2019-10-17 11:08:19 -07:00
David Lord
aaf13a231c
skip template with same name as directory
When using multiple paths with FileSystemLoader, a template with the
same name as a directory will not prevent loading a template in the
directory.
2019-10-13 06:42:44 -07:00
Armin Ronacher
bbe0a4174c Bump up the copyright to 2017 2017-01-07 16:17:14 +01:00
Armin Ronacher
73e2b51052 Cleaned up shitty syntax in testsuite 2017-01-06 21:00:01 +01:00
pgjones
1a61008d61 Change environment cache key construction
Changing from a tuple of the loader ID and template name to a weakref
to the loader and the template name should avoid situations whereby
the loader has changed, yet the cached templates are returned. This
would occur if the id of the new loader matches the old. A weakref is
preferred over a direct reference so that the loader can be garbaged
collected.
2016-05-21 16:21:22 +01:00
pgjones
7d8ec0f3e8 Change cache key definitiion in environment
In 6671b973e6 the load_template method
was altered to use a cache key other than the template name. The key
chosen was the abs path as returned from the loader get_source
method. Unless there is no path in which case the name is
used. Unfortunately this introduced a performance regression, #485, as
the get_source method (in the FileStoreLoader) loads the template
(causing IO).

The purpose of #332 was to allow the loader to change whilst ensuring
the correct template was loaded, i.e. to fix this case

    env.loader = loader1
    env.get_template('index.html') # return loader1/index.html
    env.loader = loader2
    env.get_template('index.html') # also return loader1/index.html because of cache

This commit changes the cache key to be a tuple of the id(loader) and
the template name. Therefore fixing the above case without calling the
get_source method and thereby avoiding the IO load.

A test has been added to ensure the above case works as expected, this
required a minor refactor of the caching tests.
2016-05-19 19:42:16 +01:00
Kartheek Lenkala
ee2cb97449 Rename testsuite to tests and suggestions
Remove  py.test from setup.py install_requires
Rename testsuite folder to tests.
2015-03-22 18:03:14 +05:30