Skip to content

Conversation

@Kijewski
Copy link
Contributor

This PR makes cot_macros implement Template and filter_fn instead of transcluding the macros from askama_macros. This way users of cot don't need to depend on askama in their project, but can simply use the exported trait and derive_macro from cot.

This PR makes `cot_macros` implement `Template` and `filter_fn` instead
of transcluding the macros from `askama_macros`. This way users of `cot`
don't need to depend on `askama` in their project, but can simply use
the exported trait and derive_macro from `cot`.
@github-actions github-actions bot added C-cli Crate: cot-cli (issues and Pull Requests related to Cot CLI) C-lib Crate: cot (main library crate) C-macros Crate: cot-macros labels Jan 16, 2026
@Kijewski
Copy link
Contributor Author

Kijewski commented Jan 16, 2026

Is the coverage check supposed to runs tests of another crate (askama_derive)? The last merged PR (#419) passed its CI checks, so I guess I introduced an error, but I don't know how. :-/

@m4tx
Copy link
Member

m4tx commented Jan 16, 2026

That's great, thanks a lot for the contribution! I wanted to do it myself a while ago, but I didn't see an obvious way to accomplish this, and then I never looked back at it again 😉

I'll have a look at the CI failure later.

@Kijewski
Copy link
Contributor Author

Kijewski commented Jan 16, 2026

You're welcome! :) It's only possible since askama-rs/askama#434 of askama v0.15, released last month. I guess I should have made askama_derive::{make_derive_template, make_filter_fn} more generic, though, because it cannot be combined with proc_macro_crate. :-/

@m4tx
Copy link
Member

m4tx commented Jan 16, 2026

Ah, I think I see what the problem is. The askama_derive::make_derive_template! macro outputs a documentation block, which includes a few doctests that are marked as ignore. However, we run our tests with --include-ignored, because we have some tests that are ignored by default as they depend on some external dependencies (such as database engines running in the system), and can be un-ignored if the user has these dependencies running. Normally, this doesn't apply to doctests, but it seems like our code coverage CI job passes --include-ignored to doctests as well - as we don't have any doctests marked with ignore, it doesn't make any difference to us.

The simplest solution would be to run the coverage tests in two passes, one with the regular tests and --include-ignored, and another with the doctests only and no --include-ignored. This would at least match the behaviour of other CI jobs that we have. I can open a PR with the fix if it sounds reasonable.

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

Labels

C-cli Crate: cot-cli (issues and Pull Requests related to Cot CLI) C-lib Crate: cot (main library crate) C-macros Crate: cot-macros

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants