Deprecate sage.misc.misc.sage_makedirs
mkoeppe opened this issue · 17 comments
As noted in #29093, in py3, os.makedirs learned an exist_ok option that makes sage_makedirs entirely redundant.
https://docs.python.org/3/library/os.html#os.makedirs
Since then we have dropped py2 support, so we can deprecate sage_makedirs and replace all uses in the library.
CC: @mezzarobba @orlitzky
Component: refactoring
Author: Matthias Koeppe
Branch/Commit: d3b3252
Reviewer: Kwankyu Lee, Michael Orlitzky
Issue created by migration from https://trac.sagemath.org/ticket/32987
Description changed:
---
+++
@@ -1,4 +1,6 @@
As noted in #29093, in py3, `os.makedirs` learned an `exist_ok` option that makes `sage_makedirs` entirely redundant.
+
+https://docs.python.org/3/library/os.html#os.makedirs
Since then we have dropped py2 support, so we can deprecate `sage_makedirs` and replace all uses in the library.
New commits:
81d0fff | sage.misc.temporary_file: Move SAGE_TMP implementation here |
7e78f59 | src/sage/misc/temporary_file.py: Remove use of functools.cache |
a9de636 | Merge #32986 |
52b810f | git grep -l sage_makedirs | xargs sed -E -i.bak 's/from sage.misc.misc import sage_makedirs/import os/;s/sage_makedirs[(](.*)[)]$/os.makedirs(\1, exist_ok=True)/' |
5b94d90 | Remove duplicate imports |
976ff6f | Remove remaining import of sage_makedirs |
37218da | sage.misc.misc.sage_makedirs: Deprecate |
Author: Matthias Koeppe
It works well.
I see two doctest failures with src/sage/tests/cmdline.py, but these seem related with pytest issues, not with the current branch.
Reviewer: Kwankyu Lee
Thank you!
Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. This was a forced push. New commits:
766d835 | git grep -l sage_makedirs | xargs sed -E -i.bak 's/from sage.misc.misc import sage_makedirs/import os/;s/sage_makedirs[(](.*)[)]$/os.makedirs(\1, exist_ok=True)/' |
4494364 | Remove duplicate imports |
41b015c | Remove remaining import of sage_makedirs |
e891787 | sage.misc.misc.sage_makedirs: Deprecate |
d3b3252 | sage.misc.misc (SAGE_TMP, ECL_TMP, SAGE_TMP_INTERFACE): Also replace use of sage_makedirs here |
Changed reviewer from Kwankyu Lee to Kwankyu Lee, Michael Orlitzky
This was already positively reviewed, but LGTM too after rebasing.
Thanks!
Changed branch from u/mkoeppe/deprecate_sage_misc_misc_sage_makedirs to d3b3252