sagemath/sage

Deprecate imports in sage.tests.all: no need to important into global namespace

Closed this issue · 12 comments

The file sage/tests/all.py is imported into the global namespace, and it contains

from sage.modular.modsym.tests import Test as modsym
from sage.tests.arxiv_0812_2725 import *

There is no need for these imports, so deprecate them now so we can remove them later.

Component: misc

Author: John Palmieri

Branch/Commit: 965fe8f

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/27337

Commit: 8461f13

New commits:

8461f13trac 27337: remove sage/tests/all.py

Reviewer: Travis Scrimshaw

comment:3

I am very tempted to outright remove them, but there is that part of me that says we should deprecate no matter what (when it is not a bug). I leave the final decision on that up to you, but I think it is fine to not deprecate as this does not seem to have a meaningful use being imported (perhaps I am wrong).

comment:4

I can't quite imagine a serious use, but I guess our policy is that they should be deprecated. How do you deprecate an import? Convert to lazy_import? I'm not having much luck with that, but maybe I'll try again tomorrow.

comment:5

Yes, and there is a deprecation parameter you can pass. For example in combinat/words/shuffle_product.py:

lazy_import('sage.combinat.shuffle', 'ShuffleProduct_overlapping', deprecation=15597)

Changed commit from 8461f13 to 965fe8f

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

965fe8ftrac 27337: deprecate imports in sage.tests.all

Description changed:

--- 
+++ 
@@ -4,5 +4,5 @@
 from sage.modular.modsym.tests import Test as modsym
 from sage.tests.arxiv_0812_2725 import *
 ```
-There is no need for these imports, so remove them.
+There is no need for these imports, so deprecate them now so we can remove them later.
 
comment:8

Thank you.

Changed branch from u/jhpalmieri/tests.all to 965fe8f