Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github May 22, 2025

Bumps tempfile from 3.19.1 to 3.20.0.

Changelog

Sourced from tempfile's changelog.

3.20.0

This release mostly unifies the behavior/capabilities around "keeping" temporary files:

  • Rename Builder::keep(bool) (via deprecation) to Builder::disable_cleanup(bool) to make it clear that behaves differently from NamedTempFile::keep(). The former disables automatic cleanup while the latter consumes the NamedTempFile object entirely and unsets the "temporary file" attribute (on Windows).
  • Rename TempDir::into_path (via deprecation) to TempDir::keep to mirror NamedTempFile::keep.
  • Add TempDir::disable_cleanup, NamedTempFile::disable_cleanup, and TempPath::disable_cleanup making it possible to disable automatic cleanup in-place after creating a temporary file/directory (equivalent to calling Builder::disable_cleanup before creating the file/directory).

Additionally, it adds a few spooled temporary file features:

  • Add SpooledTempFile::into_file for turning a SpooledTempFile into a regular unnamed temporary file, writing it to the backing storage ("rolling" it) if it was still stored in-memory.
  • Add spooled_tempfile_in and SpooledTempFile::new_in methods for creating spooled temporary files in a specific directory. This makes it possible to choose the backing device for your spooled temporary file which is rather important on Linux where the default temporary directory is likely backed by memory (defeating the entire point of having a spooled temporary file).

Finally, this release improves documentation, especially the top-level documentation explaining which temporary file type to use.

BREAKING for those with deny(warnings):

  • Builder::keep deprecated in favor of Builder::disable_cleanup.
  • TempDir::into_path is deprecated in favor of TempDir::keep.

BREAKING:

Commits
  • 99ffea6 chore: release v3.20.0 (#358)
  • bd2b267 feat: make it possible to disable cleanup in-place after creation (#355)
  • 3b30099 ci: really check docs for warnings (#357)
  • f701f52 ci: check docs (#356)
  • d34afe9 doc: improve SpooledData documentation
  • 6deb42e doc: make it easier to pick the correct tempfile constructor/type
  • e284782 feat: allow creating spooled temporary files in a specific directory (#353)
  • 07edc31 feat: implement SpooledTempFile::into_file (#352)
  • b122355 fix: add must_use attribute to TempDir::keep (#351)
  • cbd1e97 feat: rename TempDir::into_path to TempDir::keep (#349)
  • 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)

Summary by Sourcery

Chores:

  • Upgrade tempfile dev-dependency from 3.10.1 to 3.20.0

Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.19.1 to 3.20.0.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](Stebalien/tempfile@v3.19.1...v3.20.0)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-version: 3.20.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github May 22, 2025

Labels

The following labels could not be found: dependencies, rust. Please create them before Dependabot can add them to a pull request.

Please fix the above issues or remove invalid values from dependabot.yml.

@sourcery-ai
Copy link

sourcery-ai bot commented May 22, 2025

Reviewer's Guide

This PR updates the tempfile dependency from 3.19.1 to 3.20.0 by modifying the project’s Cargo.toml and regenerating Cargo.lock, thereby bringing in the crate’s API changes—renamed methods for disabling cleanup, new in-place disable_cleanup methods, spooled file enhancements, and documentation improvements (with breaking deprecations for Builder::keep and TempDir::into_path).

Sequence Diagram: Configuring Tempfile Creation with Builder::disable_cleanup

sequenceDiagram
    actor Client
    participant Builder
    participant TempFile
    Client->>Builder: new()
    Client->>Builder: disable_cleanup(true)
    Builder-->>Client: self
    Client->>Builder: tempfile()
    Builder-->>Client: Ok(TempFile)
Loading

Sequence Diagram: Persisting a TempDir with TempDir::keep

sequenceDiagram
    actor Client
    participant TempDir
    participant PathBuf
    Client->>TempDir: new()
    TempDir-->>Client: Ok(TempDir_instance)
    Client->>TempDir_instance: path()
    TempDir_instance-->>Client: &Path
    Client->>TempDir_instance: keep()
    TempDir_instance-->>Client: Ok(PathBuf)
Loading

Sequence Diagram: Disabling Cleanup In-Place for NamedTempFile

sequenceDiagram
    actor Client
    participant NamedTempFile
    Client->>NamedTempFile: new()
    NamedTempFile-->>Client: Ok(File_instance)
    Client->>File_instance: write_all(b"content")
    Client->>File_instance: disable_cleanup()
    File_instance-->>Client: Ok(())
Loading

Class Diagram: API Method Changes in tempfile v3.20.0

classDiagram
  class Builder {
    -keep(bool)
    +disable_cleanup(bool)
  }
  class TempDir {
    -into_path()
    +keep()
    +disable_cleanup()
  }
  class NamedTempFile {
    +disable_cleanup()
  }
  class TempPath {
    +disable_cleanup()
  }
  class SpooledTempFile {
    +into_file()
    +new_in(Path)
  }
Loading

File-Level Changes

Change Details Files
Bump tempfile crate to v3.20.0
  • Update tempfile version in Cargo.toml
  • Regenerate Cargo.lock to lock tempfile v3.20.0
Cargo.toml
Cargo.lock

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@larp0 larp0 merged commit 6f6c165 into master May 29, 2025
0 of 3 checks passed
@dependabot dependabot bot deleted the dependabot/cargo/tempfile-3.20.0 branch May 29, 2025 10:35
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.

2 participants