X Tutup
Skip to content

MAINT testing.nose -> testing._nose to make it explicitely private#7947

Merged
anntzer merged 3 commits intomatplotlib:masterfrom
NelleV:making_stuff_private
Jan 27, 2017
Merged

MAINT testing.nose -> testing._nose to make it explicitely private#7947
anntzer merged 3 commits intomatplotlib:masterfrom
NelleV:making_stuff_private

Conversation

@NelleV
Copy link
Copy Markdown
Member

@NelleV NelleV commented Jan 25, 2017

This pull request aims simply at making matplotlib.testing.nose an explicitely private module.
In practice, it is already almost invisible to the user, as not imported anywhere.

@NelleV NelleV changed the title MAINT testing.nose -> testing._nose to make it explicitely private [WIP] MAINT testing.nose -> testing._nose to make it explicitely private Jan 25, 2017
@NelleV NelleV changed the title [WIP] MAINT testing.nose -> testing._nose to make it explicitely private [MRG+1] MAINT testing.nose -> testing._nose to make it explicitely private Jan 26, 2017
@NelleV NelleV changed the title [MRG+1] MAINT testing.nose -> testing._nose to make it explicitely private [MRG] MAINT testing.nose -> testing._nose to make it explicitely private Jan 26, 2017
@QuLogic QuLogic changed the title [MRG] MAINT testing.nose -> testing._nose to make it explicitely private [MRG+1] MAINT testing.nose -> testing._nose to make it explicitely private Jan 26, 2017
@QuLogic QuLogic added this to the 2.1 (next point release) milestone Jan 26, 2017
def __init__(self):
if not has_nose:
raise ImportError("Need nose for this plugin.")
pass
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the "pass"? (or at least indent it more)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NelleV I will merge the PR if you fix this :)

from matplotlib.cbook import is_string_like, iterable
from matplotlib import rcParams, rcdefaults, use
# For backward compatibility
from . import noseclasses
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line would always raise a deprecationwarning, I guess, and is not needed for backcompat anyways as noseclasses was not directly imported anyways?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is needed for backward compatibility unless it wasn't there before (I actually did not check this, so it might be worth doing).
As far as I know, there is no choice other than raising a deprecation at import time for whole module deprecation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wasn't there in 2.0:

$ python -c 'import matplotlib.testing as t; print(t.noseclasses)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: module 'matplotlib.testing' has no attribute 'noseclasses'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woot \o/ thanks for checking.

@NelleV NelleV closed this Jan 27, 2017
@NelleV NelleV reopened this Jan 27, 2017
@NelleV
Copy link
Copy Markdown
Member Author

NelleV commented Jan 27, 2017

@anntzer It is now fixed.

@anntzer anntzer merged commit 0dfd271 into matplotlib:master Jan 27, 2017
@QuLogic QuLogic changed the title [MRG+1] MAINT testing.nose -> testing._nose to make it explicitely private MAINT testing.nose -> testing._nose to make it explicitely private Jan 27, 2017
@NelleV NelleV deleted the making_stuff_private branch January 28, 2017 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

X Tutup