Skip to content

Commit

Permalink
Merge pull request numpy#10850 from charris/deprecate-some-imports
Browse files Browse the repository at this point in the history
DEP: Issue deprecation warnings for some imports.
  • Loading branch information
charris authored Apr 9, 2018
2 parents db63ca9 + cf73c76 commit 4695366
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 9 deletions.
15 changes: 15 additions & 0 deletions numpy/core/umath_tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""
Shim for _umath_tests to allow a deprecation period for the new name.
"""
from __future__ import division, absolute_import, print_function

import warnings

# 2018-04-04, numpy 1.15.0
warnings.warn(("numpy.core.umath_tests is an internal NumPy "
"module and should not be imported. It will "
"be removed in a future NumPy release."),
category=DeprecationWarning, stacklevel=2)

from ._umath_tests import *
8 changes: 6 additions & 2 deletions numpy/testing/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
set of tools
"""
from __future__ import division, absolute_import, print_function

import warnings

warnings.warn("Import from numpy.testing, not numpy.testing.decorators",
ImportWarning)
# 2018-04-04, numpy 1.15.0
warnings.warn("Importing from numpy.testing.decorators is deprecated, "
"import from numpy.testing instead.",
DeprecationWarning, stacklevel=2)

from ._private.decorators import *
9 changes: 6 additions & 3 deletions numpy/testing/noseclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
Back compatibility noseclasses module. It will import the appropriate
set of tools
"""
from __future__ import division, absolute_import, print_function

import warnings

warnings.warn("Import from numpy.testing, not numpy.testing.noseclasses",
ImportWarning)
# 2018-04-04, numpy 1.15.0
warnings.warn("Importing from numpy.testing.noseclasses is deprecated, "
"import from numpy.testing instead",
DeprecationWarning, stacklevel=2)

from ._private.noseclasses import *

8 changes: 6 additions & 2 deletions numpy/testing/nosetester.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
set of tools
"""
from __future__ import division, absolute_import, print_function

import warnings

warnings.warn("Import from numpy.testing, not numpy.testing.nosetester",
ImportWarning)
# 2018-04-04, numpy 1.15.0
warnings.warn("Importing from numpy.testing.nosetester is deprecated, "
"import from numpy.testing instead.",
DeprecationWarning, stacklevel=2)

from ._private.nosetester import *

Expand Down
8 changes: 6 additions & 2 deletions numpy/testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
set of tools
"""
from __future__ import division, absolute_import, print_function

import warnings

warnings.warn("Import from numpy.testing, not numpy.testing.utils",
ImportWarning)
# 2018-04-04, numpy 1.15.0
warnings.warn("Importing from numpy.testing.utils is deprecated, "
"import from numpy.testing instead.",
ImportWarning, stacklevel=2)

from ._private.utils import *

Expand Down

0 comments on commit 4695366

Please sign in to comment.