github mitsuhiko/minijinja 3.0.4

2 hours ago

Release Notes

  • Fixed str.count in pycompat looping forever when counting an empty string. Like in Python, 'abc'.count('') is now 4.
  • Fixed str.islower and str.isupper in pycompat returning false for strings with spaces, digits or other uncased characters, and the str.is* predicates returning true for an empty string. They now follow Python, so 'foo bar'.islower() is true and ''.isdigit() is false.
  • Fixed str.find and str.rfind in pycompat returning byte offsets. Like in Python they now return character offsets, so 'über'.find('e') is 2.
  • Fixed integer addition, subtraction and multiplication in Go losing precision above 2**53 and clamping results that overflow 64 bits, because they were computed with floats. They are now exact, and like in Rust a result that doesn't fit 64 bits becomes a big integer, so 9007199254740993 + 0 is 9007199254740993 and 9223372036854775807 + 1 is 9223372036854775808. #981
  • Fixed booleans not being usable as integers in -, *, /, // and % and for repeating strings and sequences in Go. Like in Rust and Jinja2, true - 1 is 0 and "ab" * true is ab.
  • Fixed ** failing with a negative integer exponent in Rust. Like in Jinja2, 2 ** -1 is now 0.5. Zero to a negative power now always fails in Rust and Go like a division by zero, instead of producing inf for floats in Rust and for all numbers in Go. #982
  • Fixed ** on integers in Go being computed with floats. Like in Rust the result is now exact up to 128 bits and fails beyond that, a float base stays a float so 2.0 ** 3 is 8.0, and booleans count as integers.
  • Fixed the sort filter ignoring a comma-separated list of attributes in Go. Like in Rust, sort(attribute="name, state") now sorts by name and then by state instead of leaving the items in their original order. #979
  • Fixed the sort filter comparing strings case-sensitively when sorting by several attributes in Rust and Go. Like in Jinja2, each part of the key is now compared case-insensitively unless case_sensitive is set. An attribute list with whitespace-only entries such as "name, " also no longer sorts by an empty attribute in Rust.
  • Added the attribute and start arguments to the sum filter and the attribute argument to the join filter for Jinja2 compatibility in Rust and Go. Like in Jinja2 the arguments can be passed positionally or by keyword, and the separator of join can also be passed as d. In Go the first positional argument of sum is now the attribute rather than the start value, so sum(100) needs to be written as sum(start=100). Go previously ignored unknown keyword arguments to sum and join and now fails like Rust. Like in Jinja2, sum in Rust can now also concatenate lists when given a list as start. #980
  • Fixed the handling of none arguments to the int, float and round filters in Go. Like in Rust they now count as not given, so 2.5|round(none) is 2.0 instead of an error.
  • Fixed the join filter dropping a separator that is not a string in Go. Like in Rust it is converted to a string, so [1, 2]|join(3) is 132.

Install minijinja-cli 3.0.4

Install prebuilt binaries via shell script

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/mitsuhiko/minijinja/releases/download/3.0.4/minijinja-cli-installer.sh | sh

Install prebuilt binaries via powershell script

powershell -ExecutionPolicy Bypass -c "irm https://github.com/mitsuhiko/minijinja/releases/download/3.0.4/minijinja-cli-installer.ps1 | iex"

Download minijinja-cli 3.0.4

File Platform Checksum
minijinja-cli-aarch64-apple-darwin.tar.xz Apple Silicon macOS checksum
minijinja-cli-x86_64-apple-darwin.tar.xz Intel macOS checksum
minijinja-cli-aarch64-pc-windows-msvc.zip ARM64 Windows checksum
minijinja-cli-i686-pc-windows-msvc.zip x86 Windows checksum
minijinja-cli-x86_64-pc-windows-msvc.zip x64 Windows checksum
minijinja-cli-aarch64-unknown-linux-gnu.tar.xz ARM64 Linux checksum
minijinja-cli-i686-unknown-linux-gnu.tar.xz x86 Linux checksum
minijinja-cli-x86_64-unknown-linux-gnu.tar.xz x64 Linux checksum
minijinja-cli-armv7-unknown-linux-gnueabihf.tar.xz ARMv7 Linux checksum
minijinja-cli-aarch64-unknown-linux-musl.tar.xz ARM64 MUSL Linux checksum
minijinja-cli-i686-unknown-linux-musl.tar.xz x86 MUSL Linux checksum
minijinja-cli-x86_64-unknown-linux-musl.tar.xz x64 MUSL Linux checksum

Don't miss a new minijinja release

NewReleases is sending notifications on new releases.