Skip to content

build(deps): bump pyo3 from 0.22.1 to 0.22.2#1979

Merged
jqnatividad merged 1 commit intomasterfrom
dependabot/cargo/pyo3-0.22.2
Jul 18, 2024
Merged

build(deps): bump pyo3 from 0.22.1 to 0.22.2#1979
jqnatividad merged 1 commit intomasterfrom
dependabot/cargo/pyo3-0.22.2

Conversation

@dependabot
Copy link
Copy Markdown
Contributor

@dependabot dependabot Bot commented on behalf of github Jul 17, 2024

Bumps pyo3 from 0.22.1 to 0.22.2.

Release notes

Sourced from pyo3's releases.

PyO3 0.22.2

This release contains some minor reliability fixes building upon PyO3 0.22.1.

As PyO3 is still working on supporting freethreaded Python (upcoming in 3.13), support has been gated behind an UNSAFE_PYO3_BUILD_FREE_THREADED=1 environment variable to avoid unsuspecting users running into broken builds.

Packages built for the abi3 stable ABI will now use FFI functions for refcounting instead of inline reference count modifications on all versions of the stable ABI (previously only abi3 builds for 3.12 and up would use FFI functions). This helps mitigate interactions of old versions of the stable ABI with future CPython releases which do more complex reference counting (e.g. immortal objects, freethreaded reference counting).

The #[pymodule] declarative module now supports directly receiving options. (E.g. #[pymodule(name = "foo")], which would previously have been written as two attributes #[pymodule] #[pyo3(name = "foo")].)

A compile error on Rust 1.78 related to use of c"" literals has been fixed.

Thank you to the following contributors for the improvements:

@​davidhewitt @​FlickerSoul @​gi0baro @​Icxolu @​MatthijsKok @​styvane

Changelog

Sourced from pyo3's changelog.

[0.22.2] - 2024-07-17

Packaging

  • Require opt-in to freethreaded Python using the UNSAFE_PYO3_BUILD_FREE_THREADED=1 environment variable (it is not yet supported by PyO3). #4327

Changed

  • Use FFI function calls for reference counting on all abi3 versions. #4324
  • #[pymodule(...)] now directly accepts all relevant #[pyo3(...)] options. #4330

Fixed

  • Fix compile failure in declarative #[pymodule] under presence of #![no_implicit_prelude]. #4328
  • Fix compile failure due to c-string literals on Rust < 1.79. #4353
Commits
  • 92b0f15 release: 0.22.2
  • da9f52e only emit c-string literals on Rust 1.79 and later (#4352) (#4353)
  • 3d7e5a3 chore: update ruff configuration to resolve deprecation warning (#4346)
  • e2ebb72 use FFI calls for refcounting on all abi3 versions (#4324)
  • 7e0fc30 allow #[pymodule(...)] to accept all relevant #[pyo3(...)] options (#4330)
  • 6317570 remove BuildFlag member to avoid breaking change in patch
  • 7fed7c3 Prevent building in GIL-less environment (#4327)
  • d99fc06 docs: fixups to 0.22 migration guide (#4332)
  • 613a70b docs: use versioned links from docs to guide (#4331)
  • b50f1c3 ci: check minimal-versions on MSRV feature powerset (#4273)
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [pyo3](https://github.com/pyo3/pyo3) from 0.22.1 to 0.22.2.
- [Release notes](https://github.com/pyo3/pyo3/releases)
- [Changelog](https://github.com/PyO3/pyo3/blob/v0.22.2/CHANGELOG.md)
- [Commits](PyO3/pyo3@v0.22.1...v0.22.2)

---
updated-dependencies:
- dependency-name: pyo3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file rust Pull requests that update Rust code labels Jul 17, 2024
@jqnatividad jqnatividad merged commit fef541e into master Jul 18, 2024
@dependabot dependabot Bot deleted the dependabot/cargo/pyo3-0.22.2 branch July 18, 2024 09:28
jqnatividad added a commit that referenced this pull request May 7, 2026
- Added MarkdownTemplateOverride struct with per-field Option<String>
  fields and an `apply_to` overlay that fills any omitted field from
  the embedded defaults. Now a user can drop in a --markdown-template
  TOML containing only the templates they want to change instead of
  copying the entire default file. USAGE updated to mention this.
- New `markdown_template_override_falls_back_per_field` test locks in
  that omitted templates fall back to embedded defaults.
- Inlined `source_label` inside the toml::from_str map_err closure
  using `args.flag_markdown_template.as_deref().unwrap_or("...")`,
  removing the cross-branch tuple binding that was fragile under
  future refactors.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
jqnatividad added a commit that referenced this pull request May 8, 2026
…output (#3834)

* feat(describegpt): add --markdown-template for customizable Markdown output

Adds a `--markdown-template <file>` flag and a default
`resources/describegpt_md_defaults.toml` so users can customize the
Markdown layout without recompiling. Per-inference-type templates
(`dictionary_md_template`, `description_md_template`, `tags_md_template`,
`custom_prompt_md_template`) drive the H1/REASONING/TOKEN-USAGE wrapper,
and a separate `dictionary_md_body_template` drives the per-field table
that fills `{{ llm_response }}` for the Dictionary kind. The wrapper
templates and the body template share one Mini Jinja Environment with
custom filters: `pipe_escape`, `br_replace`, `human_count`, `dict_cell`,
`humanize_examples`. Defaults reproduce the legacy hardcoded `format!()`
output byte-for-byte; two embedded tests lock that in.

Also fixes a pre-existing race in `get_prompt_file` where two threads
racing to initialize `PROMPT_FILE` would panic the loser via
`OnceLock::set().unwrap()`; now the loser silently uses the winner's
value (same pattern as the new `get_md_template_file`).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(describegpt): address roborev review #1976 (5 Low findings)

- Thread a single SharedRenderCtx (attribution + timestamp) through
  render_dictionary_md_body and render_markdown_template so the body
  footer's attribution and the wrapper's `{{ timestamp }}` /
  `{{ generated_by_signature }}` are byte-identical in the same phase.
- Cache the Mini Jinja Environment in a LazyLock so filters
  (pipe_escape, br_replace, human_count, dict_cell, humanize_examples)
  are registered once instead of on every render call.
- Add `default_wrapper_templates_are_byte_identical` test plus a TOML
  comment locking the four wrapper templates in sync — drift fails
  loudly instead of silently diverging.
- Reuse the shared timestamp from the SharedRenderCtx (no second
  `chrono::Utc::now()` call per dictionary phase).
- Add a doc comment on PROMPT_FILE / MD_TEMPLATE_FILE explaining the
  test-binary singleton constraint and what tests touching custom
  templates would need.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore: rust fmt

* address review: copilot comments on PR #3834

- USAGE help and generated docs now mention dictionary_md_body_template
  and the available custom Mini Jinja filters, pointing users at the
  inline variable/filter docs in the default TOML.
- Markdown template TOML parse error now includes the source path (or
  "<default embedded TOML>") so users can tell which file failed.
- Metadata fields (name/description/author/version) on
  MarkdownTemplateFile are now `#[serde(default)]` so users can supply
  a minimal --markdown-template file without copying the metadata
  header.
- Replaced struct-level `#[allow(dead_code)]` with per-field allows
  on only the genuinely-unused metadata fields, so future genuinely
  unused additions get caught.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(describegpt): address roborev review #1979 (2 Low findings)

- Added MarkdownTemplateOverride struct with per-field Option<String>
  fields and an `apply_to` overlay that fills any omitted field from
  the embedded defaults. Now a user can drop in a --markdown-template
  TOML containing only the templates they want to change instead of
  copying the entire default file. USAGE updated to mention this.
- New `markdown_template_override_falls_back_per_field` test locks in
  that omitted templates fall back to embedded defaults.
- Inlined `source_label` inside the toml::from_str map_err closure
  using `args.flag_markdown_template.as_deref().unwrap_or("...")`,
  removing the cross-branch tuple binding that was fragile under
  future refactors.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(describegpt): apply nightly rustfmt

CI uses `cargo +nightly fmt --check`, which respects the unstable
`struct_field_align_threshold = 20` in rustfmt.toml. My local stable
rustfmt silently ignores that option, so a few struct field declarations
landed with hand-aligned colons that nightly rejects. Run nightly fmt
to bring the file in line with what CI expects.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(describegpt): normalize line endings on markdown template load (Windows CI)

The markdown_default_template_byte_identical_to_legacy and
dictionary_body_default_template_byte_identical_to_legacy tests fail on
Windows runners because:
  - `* text=auto` in .gitattributes lets git check out *.toml with CRLF
    on Windows; `include_str!` then bundles the embedded default
    `describegpt_md_defaults.toml` with CRLF in its template strings.
  - Mini Jinja preserves the source line endings verbatim, so the
    rendered Markdown carries CRLF on Windows.
  - The legacy `format!()` baseline the tests compare against is LF only.

Two-pronged fix:
  1. Code-level: normalize CRLF -> LF in `get_md_template_file` before
     handing content to `toml::from_str`, so both the embedded default
     and any user-supplied --markdown-template TOML render with LF
     regardless of the platform git checked them out on.
  2. .gitattributes: add `*.toml text eol=lf` so the TOML files are
     committed AND checked out as LF on every platform.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant