Skip to content

Commit

Permalink
fix #160
Browse files Browse the repository at this point in the history
  • Loading branch information
bckohan committed Jul 18, 2024
1 parent 0e821a3 commit f6e0b34
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
5 changes: 5 additions & 0 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Change Log
==========

v3.1.2 (18-JUL-2024)
====================

* Fixed `BatchLoaders should not try to load pycache files. <https://github.com/bckohan/django-render-static/issues/160>`_

v3.1.1 (18-JUL-2024)
====================

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "django-render-static"
version = "3.1.1"
version = "3.1.2"
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."
authors = ["Brian Kohan <[email protected]>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion render_static/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""

VERSION = (3, 1, 1)
VERSION = (3, 1, 2)

__title__ = "Django Render Static"
__version__ = ".".join(str(i) for i in VERSION)
Expand Down
3 changes: 1 addition & 2 deletions render_static/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,8 +730,7 @@ def resolve_renderings(
continue
if any((tmpl_abs_path == excl for excl in excluded_files)):
continue
if "__pycache__" in tmpl_abs_path.parts:
continue

yield Render(
selector=selector,
config=config,
Expand Down
10 changes: 7 additions & 3 deletions render_static/loaders/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ def select_templates(self, selector: str) -> Generator[List[str], None, None]:
# (it might be inside another one, so this isn't fatal).
continue

yield [
relpath(file, template_dir) for file in glob(pattern, recursive=True)
]
templates = []
for file in glob(pattern, recursive=True):
pth = relpath(file, template_dir)
if "__pycache__" in Path(pth).parts:
continue
templates.append(pth)
yield templates

0 comments on commit f6e0b34

Please sign in to comment.