Skip to content

Comments

Fix .yml files extensions in workflows file and napari-hub config file#26

Merged
DragaDoncila merged 1 commit intonapari:mainfrom
tha-santacruz:fixing_files_extensions
Mar 5, 2025
Merged

Fix .yml files extensions in workflows file and napari-hub config file#26
DragaDoncila merged 1 commit intonapari:mainfrom
tha-santacruz:fixing_files_extensions

Conversation

@tha-santacruz
Copy link
Contributor

Fixes #25

Copy link
Contributor

@willingc willingc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tha-santacruz for the PR.

cc/ @DragaDoncila will you give this a review. thanks.

Copy link
Contributor

@DragaDoncila DragaDoncila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for the issue and the fix @tha-santacruz 🎉

@DragaDoncila DragaDoncila merged commit 67613cc into napari:main Mar 5, 2025
12 checks passed
@imagejan
Copy link

The two files touched by this PR don't contain any dynamic content requiring the .jinja extension, as far as I can see. Wouldn't it be sufficient to name them just test_and_deploy.yml and config.yml, without the .jinja extension?

@TimMonko
Copy link
Contributor

Thanks for the comments @imagejan, test_and_deploy.yml.jinja does use some jinja syntax (i.e. {% raw %}), so that would need to remain. From my perspective, keeping then all 'template' files with a .jinja extension seems like a nice pattern for template files -- so I would personally keep config.yml.jinja as is. Is there a reason you'd perhaps do this differently?

@imagejan
Copy link

Thanks @TimMonko for the quick reply.

The {% raw %} part in test_and_deploy.yml.jinja wraps the entire content and serves basically to escape braces {{ and other code that otherwise would get interpolated by jinja.

My thinking was that it's easier for template maintainers (and possible contributors) to see if a file is static (i.e. included as is) or dynamic (i.e. variables etc. interpolated by jinja) depending on the absence or presence of the .jinja extension in the file name.

To keep it simple, I would default to static files unless you need adaptation by templating. See also the documentation at https://copier.readthedocs.io/en/stable/creating/:

The content of the files inside the project template is copied to the destination without changes, unless they end with .jinja (or your chosen suffix). In that case, the templating engine will be used to render them.

Your mileage may vary, of course, I just stumbled upon this and wanted to mention it. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing file extensions in workflow and configuration files

5 participants