Skip to content

Commit

Permalink
Trac #33308: Remove expired deprecations that use lazy_import(MODULE,…
Browse files Browse the repository at this point in the history
… "*")

After building Sage, in the first run, Sage spends some time building
the "lazy import cache".

This whole mechanism (from #8456, modified in #11924, #12670) is
currently only used for a total of 3 re-imports with deprecation. They
could be easily be rewritten by just listing all symbols instead of
using "*"; but it turns out that the deprecations have all expired
already (#19150, #26370, #27337), so we can remove them.

{{{
$ git grep '^lazy_import.*[*]'
src/sage/combinat/lyndon_word.py:lazy_import('sage.combinat.words.lyndon
_word', '*', deprecation=19150)
src/sage/rings/invariant_theory.py:lazy_import('sage.rings.invariants.in
variant_theory', '*', deprecation=26370)
src/sage/tests/all.py:lazy_import('sage.tests.arxiv_0812_2725', '*',
deprecation=27337)
}}}

URL: https://trac.sagemath.org/33308
Reported by: mkoeppe
Ticket author(s): Matthias Koeppe
Reviewer(s): Michael Orlitzky
  • Loading branch information
Release Manager committed Mar 7, 2022
2 parents 00c2f53 + be8a401 commit 6fb8e9a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 31 deletions.
7 changes: 0 additions & 7 deletions src/sage/combinat/lyndon_word.py

This file was deleted.

2 changes: 0 additions & 2 deletions src/sage/rings/invariant_theory.py

This file was deleted.

22 changes: 0 additions & 22 deletions src/sage/tests/all.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,2 @@
"""
TESTS:
Test the deprecation warnings::
sage: tests.CompleteMatchings
doctest:warning
...
DeprecationWarning:
Importing CompleteMatchings from here is deprecated. If you need to use it, please import it directly from sage.tests.arxiv_0812_2725
See https://trac.sagemath.org/27337 for details.
<function CompleteMatchings at ...>
sage: tests.modsym
doctest:warning
...
DeprecationWarning:
Importing modsym from here is deprecated. If you need to use it, please import it directly from sage.modular.modsym.tests
See https://trac.sagemath.org/27337 for details.
<class ...sage.modular.modsym.tests.Test...>
"""

from sage.misc.lazy_import import lazy_import
lazy_import('sage.modular.modsym.tests', 'Test', as_='modsym', deprecation=27337)
lazy_import('sage.tests.arxiv_0812_2725', '*', deprecation=27337)

0 comments on commit 6fb8e9a

Please sign in to comment.