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

Update Rust crate minijinja to v1 #223

Merged
merged 1 commit into from
Jan 26, 2024
Merged

Update Rust crate minijinja to v1 #223

merged 1 commit into from
Jan 26, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jun 16, 2023

Mend Renovate

This PR contains the following updates:

Package Type Update Change
minijinja dependencies major 0.33 -> 1.0

Release Notes

mitsuhiko/minijinja (minijinja)

v1.0.10

Compare Source

  • Added int and float filters. #​372
  • Added integer and float tests. #​373
  • Fixed an issue that caused the CLI not to run when the repl feature
    was disabled. #​374
  • Added -n / --no-newline option to CLI. #​375

v1.0.9

Compare Source

  • Fixed a memory leak involving macros. Previously using macros was
    leaking memory due to an undetected cycle. #​359
  • The debug function in templates can now also be used to print out
    the debug output of a variable. #​356
  • Added a new stacker feature which allows raising of the recursion
    limits. It enables monitoring of the call stack via stacker
    and automatically acquires additional memory when the call stack
    runs out of space. #​354

v1.0.8

Compare Source

  • Large integer literals in templates are now correctly handled. #​353
  • Relax the trait bounds of Value::downcast_object_ref /
    Object::downcast_ref / Object::is and added support for downcasting
    of types that were directly created with Value::from_seq_object
    and Value::from_struct_object. #​349
  • Overflowing additions on very large integers now fails rather than
    silently wrapping around. #​350
  • Fixed a few overflow panics: dividing integers with an overflow and
  • Exposed missing new functionality for the Python binding. #​339

v1.0.7

Compare Source

  • Added support for keep_trailing_newlines which allows you to disable
    the automatic trimming of trailing newlines. #​334
  • Added minijinja-cli which lets you render and debug templates from
    the command line. #​331
  • Macros called with the wrong state will no longer panic. #​330
  • Debug output of Value::UNDEFINED and Value::from(()) is now
    undefined and none rather than Undefined and None. This was
    an accidental inconsistency.
  • Fixed a potential panic in debug error printing.
  • Added Environment::set_path_join_callback and State::get_template
    to support path joining. This is for greater compatibility with Jinja2
    where path joining was overridable. With this you can configure the
    engine so that paths used by include or extends can be relative to
    the current template. #​328
  • The default auto-escape detection now accepts .html.j2 as alias for
    .html as well as for all other choices. In general .j2 as an extension
    is now generally supported.

v1.0.6

Compare Source

  • Fixed iso datetime formatting not handling negative offsets correctly. #​327
  • Re-report Value directly from the crate root for convenience.
  • It's now possible to deserialize from a Value. Additionally the
    ViaDeserialize<T> argument type was added to support value conversions
    via serde as argument type. #​325

v1.0.5

  • Added the ability to merge multiple values with the context!
    macro. (#​317)
  • Option<T> now accepts none in filters. Previously only
    undefined values were accepted. This bugfix might have a minor impact
    on code that relied in this behavior. (#​320)
  • Fix a compilation error for minijinja-contrib if the timezone
    feature is not enabled.

v1.0.4

  • Added the args! macro which can be used to create an argument
    slice on the stack. (#​311)
  • Improved error reporting for missing keyword arguments.
  • Added chrono support to the time filters in the minijinja-contrib crate.

v1.0.3

Compare Source

  • Republished 1.0.2 with fixed docs.

v1.0.2

Compare Source

  • Added TryFrom and ArgType for Arc<str>.
  • Added datetimeformat, dateformat, timeformat and now() to the
    contrib crate. (#​309)

v1.0.1

Compare Source

  • Added Environment::compile_expression_owned to allow compiled expressions
    to be held without requiring a reference. #​383

v1.0.0

Compare Source

  • Support unicode sorting for filters when the unicode feature is enabled.
    This also fixes confusing behavior when mixed types were sorted. (#​299)

  • Added json5 as file extension for JSON formatter.

  • The autoreload crate now supports fast reloading by just clearning the
    already templates. This is enabled via set_fast_reload on the
    Notifier.

Note: This also includes all the changes in the different 1.0.0 alphas.

Breaking Changes

1.0 includes a lot of changes that are breaking. However they should with
some minor exceptions be rather trivial changes.

  • Environment::source, Environment::set_source and the Source type
    together with the source feature were removed. The replacement is the
    new loader feature which adds the add_template_owned and set_loader
    APIs. The functionality previously provided by Source::from_path is
    now available via path_loader.

    Old:

    let mut source = Source::with_loader(|name| ...);
    source.add_template("foo", "...").unwrap();
    let mut env = Environment::new();
    env.set_source(source);

    New:

    let mut env = Environment::new();
    env.set_loader(|name| ...);
    env.add_template_owned("foo", "...").unwrap();

    Old:

    let mut env = Environment::new();
    env.set_source(Source::from_path("templates"));

    New:

    let mut env = Environment::new();
    env.set_loader(path_loader("templates"));
  • Template::render_block and Template::render_block_to_write were
    replaced with APIs of the same name on the State returned by
    Template::eval_to_state or Template::render_and_return_state:

    Old:

    let rv = tmpl.render_block("name", ctx)?;

    New:

    let rv = tmpl.eval_to_state(ctx)?.render_block("name")?;
  • Kwargs::from_args was removed as API as it's no longer necessary since
    the from_args function now provides the same functionality:

    Before:

    // just split
    let (args, kwargs) = Kwargs::from_args(values);
    
    // split and parse
    let (args, kwargs) = Kwargs::from_args(values);
    let (a, b): (i32, i32) = from_args(args)?;

    After:

    // just split
    let (args, kwargs): (&[Value], Kwargs) = from_args(values)?;
    
    // split and parse
    let (a, b, kwargs): (i32, i32, Kwargs) = from_args(values)?;
  • The testutils feature and testutils module were removed. Instead you
    can now directly create an empty State and use the methods provided
    to invoke filters.

    Before:

    let env = Environment::new();
    let rv = apply_filter(&env, "upper", &["hello world".into()]).unwrap();

    After:

    let env = Environment::new();
    let rv = env.empty_state().apply_filter("upper", &["hello world".into()]).unwrap();

    Before:

    let env = Environment::new();
    let rv = perform_test(&env, "even", &[42.into()]).unwrap();

    After:

    let env = Environment::new();
    let rv = env.empty_state().perform_test("even", &[42.into()]).unwrap();

    Before:

    let env = Environment::new();
    let rv = format(&env, 42.into()).unwrap();

    After:

    let env = Environment::new();
    let rv = env.empty_state().format(42.into()).unwrap();
  • intern and some APIs that use Arc<String> now use Arc<str>. This
    means that for instance StructObject::fields returns Arc<str> instead
    of Arc<String>. All the type conversions that previously accepted
    Arc<String> now only support Arc<str>.

  • State::current_call was removed without replacement. This information
    was unreliably maintained in the engine and caused issues with recursive
    calls. If you have a need for this API please reach out on the issue
    tracker.

  • Output::is_discarding was removed without replacement. This is
    an implementation detail and was unintentionally exposed. You should not
    write code that depends on the internal state of the Output.

v0.34.0

Compare Source

  • Updated self_cell and percent-encoding dependencies. (#​264)

  • Added Template::render_block and Template::render_block_to_write which
    allows rendering a single block in isolation. (#​262)


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate
Copy link
Contributor Author

renovate bot commented Jun 16, 2023

⚠ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: Cargo.lock
Command failed: docker run --rm --name=renovate_a_sidecar --label=renovate_a_child -v "/tmp/worker/5190cb/65f4e7/repos/github/zdz/ServerStatus-Rust":"/tmp/worker/5190cb/65f4e7/repos/github/zdz/ServerStatus-Rust" -v "/tmp/worker/5190cb/65f4e7/cache":"/tmp/worker/5190cb/65f4e7/cache" -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/worker/5190cb/65f4e7/repos/github/zdz/ServerStatus-Rust" ghcr.io/containerbase/sidecar bash -l -c "install-tool rust 1.70.0 && cargo update --manifest-path server/Cargo.toml --workspace"
install: WARNING: failed to run ldconfig. this may happen when not installing as root. run with --verbose to see the error
    Updating crates.io index
error: failed to select a version for `minijinja`.
    ... required by package `stat_server v1.7.2 (/tmp/worker/5190cb/65f4e7/repos/github/zdz/ServerStatus-Rust/server)`
versions that meet the requirements `^1.0` are: 1.0.0

the package `stat_server` depends on `minijinja`, with features: `source` but `minijinja` does not have these features.


failed to select a version for `minijinja` which could resolve this conflict

@renovate renovate bot changed the title fix(deps): update rust crate minijinja to v1 Update Rust crate minijinja to v1 Dec 25, 2023
@zdz zdz merged commit 2d1cd48 into master Jan 26, 2024
@renovate renovate bot deleted the renovate/minijinja-1.x branch January 26, 2024 14:41
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.

1 participant