-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: djc-safe-eval - Jinja's sandboxed python expression evaluation #17
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
base: main
Are you sure you want to change the base?
Changes from 9 commits
d5e4993
9c3f07f
7ea78f9
0503d24
32d7af9
76ad82e
1c9f09d
41bfc1c
0e14b4e
d8c9b42
efe8e8c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| [submodule "crates/djc-safe-eval/submodules/ruff"] | ||
| path = crates/djc-safe-eval/submodules/ruff | ||
| url = https://github.com/astral-sh/ruff.git | ||
| # tag = 0.14.0 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was the first time that I was using git modules. I'm surprised that it's actually managed quite implicitly? To change a commit/tag/branch of the "submodule", you have to:
What I find strange about this is that you have to use git to find out what commit/tag/branch the submodule is on. That's why I adding this I documented the entire process in djc-safe-eval's README. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This relates to testing in CI.
So since the djc-safe-eval package contains ruff dependencies as git submodules, then simply calling
cargo testwill also run tests for those ruff packages. And there is one that fails. And because this is in CI, it blocked the pipeline.So I wanted to exclude the Ruff packages from running their tests when in CI.
But the problem is that
cargo testdoesn't allow to exclude packages by pattern. Then I could've used^ruffand call it a day.Second option was to list all local packages, so only our packages run. But that's not a good design - I'm 100% that I'd forget to add a new Rust package to this file if I created one.
So the compromise here is to have a bit of script that lists all OUR packages (those in
crates/), and then format thecargo testcommand to use only those packages:cargo test -p <package> -p <package>