Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions pkgs/sagemath-repl/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ include sage/misc/sage_input.py
include sage/misc/sage_eval.py

# expect_objects from sage.interfaces.quit is needed to compute the
# CPU time used by each doctest. We include sage.interfaces.cleaner
# because it is conditionally imported by sage.interfaces.quit.
# CPU time used by each doctest.
include sage/interfaces/quit.py
include sage/interfaces/cleaner.py

include VERSION.txt

Expand Down
1 change: 0 additions & 1 deletion src/doc/en/reference/interfaces/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ and testing to make sure nothing funny is going on).
sage/interfaces/tachyon
sage/interfaces/tides

sage/interfaces/cleaner
sage/interfaces/quit
sage/interfaces/read_data

Expand Down
48 changes: 0 additions & 48 deletions src/sage/interfaces/cleaner.py

This file was deleted.

1 change: 0 additions & 1 deletion src/sage/interfaces/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ py.install_sources(
'all.py',
'all__sagemath_polyhedra.py',
'axiom.py',
'cleaner.py',
'ecm.py',
'expect.py',
'four_ti_2.py',
Expand Down
15 changes: 2 additions & 13 deletions src/sage/interfaces/quit.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,8 @@ def sage_spawned_process_file() -> str:
sage: len(sage_spawned_process_file()) > 1
True
"""
# This is the old value of SAGE_TMP. Until sage-cleaner is
# completely removed, we need to leave these spawned_processes
# files where sage-cleaner will look for them.
d = os.path.join(DOT_SAGE, "temp", HOSTNAME, str(os.getpid()))
os.makedirs(d, exist_ok=True)
return os.path.join(d, "spawned_processes")
from sage.misc.temporary_file import tmp_dir
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it much work to migrate this to the built-in python tempdir?

(Triggered by the fact the last PR that touched the cleaner interface #33213 notes "Afterward, the custom functions tmp_dir() and tmp_filename() can be deprecated in favor of tempfile.TemporaryDirectory() and tempfile.NamedTemporaryFile().")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't been able to make it work. If I use TemporaryDirectory then the directory seems to be deleted immediately, unless I use delete=False, in which case it is not removed on sage exit.

This seems to be similar to the parallel doctesting issues we found on Python 3.13 upgrade, see #39201 (cc @tornaria)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, thanks for checking!

return os.path.join(tmp_dir(), "spawned_processes")


def register_spawned_process(pid: int, cmd: str = "") -> None:
Expand All @@ -58,13 +54,6 @@ def register_spawned_process(pid: int, cmd: str = "") -> None:
file.write("%s %s\n" % (pid, cmd))
except OSError:
pass
else:
# If sage is being used as a python library, we need to launch
# the cleaner ourselves upon being told that there will be
# something to clean.
from sage.interfaces.cleaner import start_cleaner

start_cleaner()


expect_objects: list[ReferenceType[Expect]] = []
Expand Down
Loading