PYTHON-5991 - [pymongocrypt] Bundle libmongocrypt 1.20.2 - #1216
Draft
blink1073 wants to merge 5 commits into
Draft
PYTHON-5991 - [pymongocrypt] Bundle libmongocrypt 1.20.2#1216blink1073 wants to merge 5 commits into
blink1073 wants to merge 5 commits into
Conversation
Bump the bundled libmongocrypt version and regenerate the SBOM. The C sources in this repo already contain everything through the 1.20.2 tag, so binding.py needs no regeneration. Also correct the text_opts docstrings, which still referred to the "textPreview" algorithm. That name was removed in libmongocrypt 1.20.0 in favor of "string".
blink1073
marked this pull request as ready for review
August 14, 2026 20:05
blink1073
marked this pull request as draft
August 17, 2026 11:39
libmongocrypt asks drivers to expose these options as "string" rather than "text", so rename the parameter to match the algorithm it configures. Add tests for the deprecated spellings that libmongocrypt still accepts or rejects, so a future libmongocrypt bump cannot change either behavior silently: - the "textPreview" algorithm raises - "prefixPreview", "suffixPreview", and "substringPreview" produce payloads identical to "prefix", "suffix", and "substring" PYTHON-5959 drops the three query type aliases. Also correct the changelog, which claimed those three query types had already been replaced. They remain accepted as aliases.
The changelog now heads the release as 1.19.0, so bump __version__ to match. hatch reads the version from this file, so the built wheel carries it. The SBOM freshness check pointed at "update-sbom.sh", which does not exist. The script that regenerates the SBOM is scripts/update-version.sh.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bundles libmongocrypt 1.20.2 and renames the
text_optsparameter tostring_opts. The rename is breaking, so this becomes release 1.19.0 rather than a patch.Motivation
PYTHON-5991 asks for bundled libmongocrypt at 1.20.2 or greater. The wheel build reads the version from
scripts/libmongocrypt-version.txt, so that file determines which libmongocrypt a released wheel links against. 1.20.1 and 1.20.2 add validation of GCP KMS request fields.The rename follows an instruction in the libmongocrypt header: driver public APIs should use the name "string" rather than "text" for these options. The parameter configures the algorithm now called "string", so
text_optsno longer matches anything a caller sees.Worth knowing for review: the C sources on this branch already contain everything through the 1.20.2 tag, since
HEADdescends from it andgit diff 1.20.0 1.20.2 -- src/mongocrypt.his empty. There is no new C API to expose, sobinding.pyis deliberately untouched.Changes
text_optsparameter tostring_optson explicit encryptionscripts/update-version.sh, replacing a reference to a script that does not existTesting
Built libmongocrypt locally on macOS (Debug, CommonCrypto) and ran the Python suite against it:
Both new tests were checked against a deliberately broken variant to confirm they are not vacuous. Changing
textPreviewtostringmakes the first fail, and pointing the alias test at a nonexistent*Bogusquery type makes the second fail.The two new tests pin behavior that is easy to change by accident:
The SBOM freshness check from
.evergreen/test.shpasses against the regenerated file. Pre-commit passes, includingsynchro,shellcheck,ruff, andruff-format.Breaking changes
text_optsis renamed tostring_optsonExplicitEncryptOptsandExplicitEncrypter.encrypt, with no alias kept for the old name. Callers passing it as a keyword argument will raiseTypeError; callers passing it positionally are unaffected.The parameter has shipped since 1.16, so this is a visible API change. It only ever configured the algorithm that 1.16 documented as "experimental only" and "not intended for public use", which is why the rename is clean rather than deprecated in place. Say so if you would rather accept both names for a release.