Skip to content

Commit

Permalink
src/sage/misc/misc.py: Remove SAGE_TMP ECL_TMP SPYX_TMP, deprecated in
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed Apr 27, 2024
1 parent 9919794 commit 47c63ec
Showing 1 changed file with 0 additions and 73 deletions.
73 changes: 0 additions & 73 deletions src/sage/misc/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,79 +178,6 @@ def try_read(obj, splitlines=False):
return data


#################################################
# Next we create the Sage temporary directory.
#################################################


@lazy_string
def SAGE_TMP():
"""
EXAMPLES::
sage: from sage.misc.misc import SAGE_TMP
sage: SAGE_TMP
doctest:warning...
DeprecationWarning: SAGE_TMP is deprecated; please use python's
"tempfile" module instead.
See https://github.com/sagemath/sage/issues/33213 for details.
l'.../temp/...'
"""
from sage.misc.superseded import deprecation
deprecation(33213, "SAGE_TMP is deprecated; please use python's \"tempfile\" module instead.")
d = os.path.join(DOT_SAGE, 'temp', HOSTNAME, str(os.getpid()))
os.makedirs(d, exist_ok=True)
return d


@lazy_string
def ECL_TMP():
"""
Temporary directory that should be used by ECL interfaces launched from
Sage.
EXAMPLES::
sage: from sage.misc.misc import ECL_TMP
sage: ECL_TMP
doctest:warning...
DeprecationWarning: ECL_TMP is deprecated and is no longer used
by the ECL interface in sage
See https://github.com/sagemath/sage/issues/33213 for details.
...
"""
from sage.misc.superseded import deprecation
deprecation(33213, "ECL_TMP is deprecated and is no longer used by the ECL interface in sage")
import atexit
import tempfile
d = tempfile.TemporaryDirectory()
result = os.path.join(d.name, 'ecl')
atexit.register(lambda: d.cleanup())
return result


@lazy_string
def SPYX_TMP():
r"""
EXAMPLES::
sage: from sage.misc.misc import SPYX_TMP
sage: SPYX_TMP
doctest:warning...
DeprecationWarning: SPYX_TMP is deprecated;
use sage.misc.temporary_file.spyx_tmp instead
See https://github.com/sagemath/sage/issues/33213 for details.
...
"""
from sage.misc.temporary_file import spyx_tmp
from sage.misc.superseded import deprecation
deprecation(33213, "SPYX_TMP is deprecated; use sage.misc.temporary_file.spyx_tmp instead")
return spyx_tmp()


SAGE_DB = os.path.join(DOT_SAGE, 'db')
os.makedirs(SAGE_DB, exist_ok=True)

Expand Down

0 comments on commit 47c63ec

Please sign in to comment.