Skip to content

Fix Python <3.12 compatibility in DiskCheckpointer#5010

Merged
connorjward merged 1 commit intofiredrakeproject:mainfrom
dsroberts:dsroberts/tempdir-compat
Apr 9, 2026
Merged

Fix Python <3.12 compatibility in DiskCheckpointer#5010
connorjward merged 1 commit intofiredrakeproject:mainfrom
dsroberts:dsroberts/tempdir-compat

Conversation

@dsroberts
Copy link
Copy Markdown
Contributor

Description

#4891 introduced the use of tempfile.TemporaryDirectory in DiskCheckpointer which is created with the delete parameter. This parameter was introduced in Python 3.12, and therefore this commit breaks compatibility with Python 3.10 and 3.11. pyproject.toml states that Python >= 3.10 is supported. Due to OS constraints, we'll be stuck on Python 3.11 on our HPC systems for some time.

This PR replaces delete=True with a destructor for the DiskCheckpointer class that calls the TemporaryDirectory's built-in cleanup() method on deletion of the DiskCheckpointer object.

firedrakeproject#4891 introduced the use of tempfile.TemporaryDirectory with the
`delete` parameter. This was introduced in Python 3.12, and therefore
this commit breaks compatibility with Python 3.10 and 3.11.
pyproject.toml states that Python >= 3.10 is supported. Due to OS
constraints, we'll be stuck on Python 3.11 on our HPC systems for some
time.
@connorjward connorjward merged commit c3bcc14 into firedrakeproject:main Apr 9, 2026
6 of 7 checks passed
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