Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #160 #161

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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