Skip to content

Commit 5cd52d7

Browse files
authored
Merge pull request #161 from bckohan/v3.x.x
fix #160
2 parents af2e014 + f6e0b34 commit 5cd52d7

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

doc/source/changelog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
Change Log
33
==========
44

5+
v3.1.2 (18-JUL-2024)
6+
====================
7+
8+
* Fixed `BatchLoaders should not try to load pycache files. <https://github.com/bckohan/django-render-static/issues/160>`_
9+
510
v3.1.1 (18-JUL-2024)
611
====================
712

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "django-render-static"
3-
version = "3.1.1"
3+
version = "3.1.2"
44
description = "Use Django's template engine to render static files at deployment or package time. Includes transpilers for extending Django's url reversal and enums to JavaScript."
55
authors = ["Brian Kohan <[email protected]>"]
66
license = "MIT"

render_static/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
"""
99

10-
VERSION = (3, 1, 1)
10+
VERSION = (3, 1, 2)
1111

1212
__title__ = "Django Render Static"
1313
__version__ = ".".join(str(i) for i in VERSION)

render_static/engine.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -730,8 +730,7 @@ def resolve_renderings(
730730
continue
731731
if any((tmpl_abs_path == excl for excl in excluded_files)):
732732
continue
733-
if "__pycache__" in tmpl_abs_path.parts:
734-
continue
733+
735734
yield Render(
736735
selector=selector,
737736
config=config,

render_static/loaders/mixins.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ def select_templates(self, selector: str) -> Generator[List[str], None, None]:
4343
# (it might be inside another one, so this isn't fatal).
4444
continue
4545

46-
yield [
47-
relpath(file, template_dir) for file in glob(pattern, recursive=True)
48-
]
46+
templates = []
47+
for file in glob(pattern, recursive=True):
48+
pth = relpath(file, template_dir)
49+
if "__pycache__" in Path(pth).parts:
50+
continue
51+
templates.append(pth)
52+
yield templates

0 commit comments

Comments
 (0)