Skip to content

Messaging improvement: mention template evaluation during file copying #11328

@jayaddison

Description

@jayaddison

Describe the bug

The messaging of copying static files can be inaccurate in cases where Sphinx copies content that includes templated files (because those are evaluated by jinja and the results are written instead of the original template's contents).

This may be rare, but it's particularly incongruous messaging when builds treat warnings as failures, as seen here: https://github.com/astropy/sphinx-automodapi/actions/runs/4694556705/jobs/8322825594#step:8:170

copying static files... failed
...
Failed to copy a file in html_static_file: /home/runner/work/sphinx-automodapi/sphinx-automodapi/.tox/py310-test-sphinxdev/lib/python3.10/site-packages/alabaster/static/alabaster.css_t: OldJinjaSuffixWarning("'/home/runner/work/sphinx-automodapi/sphinx-automodapi/.tox/py310-test-sphinxdev/lib/python3.10/site-packages/alabaster/static/alabaster.css_t': the '_t' suffix for Jinja templates is deprecated. If the file is a template, use the suffix '.jinja' instead. For more information, see https://www.sphinx-doc.org/en/master/development/theming.html#static-templates")

As a possible improvement I'd suggest copying static files and evaluating Jinja templates.

How to Reproduce

Invoking the sphinx-build -b html . _build command to build a Sphinx project as HTML emits this message as part of the output.

Environment Information

Platform:              linux; (Linux-6.1.0-7-amd64-x86_64-with-glibc2.36)
Python version:        3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0])
Python implementation: CPython
Sphinx version:        6.2.0+/b6e6805f8
Docutils version:      0.19
Jinja2 version:        3.1.2
Pygments version:      2.15.0

Sphinx extensions

N/A

Additional context

Localisation of the updated message will be required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions