-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
MAINT: deprecate validCap, validJoin #18817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MAINT: deprecate validCap, validJoin #18817
Conversation
b884fe9
to
c505b7b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't normally put a full version number with micro component.
I would also maybe wait until deprecation machinery is properly exposed from |
4f55d60
to
384d96a
Compare
Should be clean of any new references to |
384d96a
to
d9674c3
Compare
@timhoffm Can you review whether this is the way you want |
Per the call, this should wait until I silence the deprecation warnings this emits in conf.py, specifically for autodoc. |
c6c3cd6
to
aed162f
Compare
Extra warnings have been quenched in |
lib/matplotlib/_api/deprecation.py
Outdated
@@ -16,6 +16,42 @@ | |||
import warnings | |||
|
|||
|
|||
# has to be here (instead of cbook) to prevent circular import, since | |||
# deprecation.deprecated is *used* during cbook's import | |||
class _classproperty: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since _api
is already private.
class _classproperty: | |
class classproperty: |
Also, this isn't actually a deprecation; does it belong in this file, or in _api/__init__.py
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the functions in _api.deprecation
are still underscore delimited for direct importing into cbook.deprecation
, happy to fix this one as long as you guys (@timhoffm) are cool with me sending in another PR to do this to the rest of the methods in _api
, since I would feel gross if we end up with some random combination of underscores and no underscores.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, almost missed your other question. It should be in __init__
now that deprecation
isn't in cbook
there's no more import-time circular stuff that can't be avoided by a local import.
lib/matplotlib/_api/deprecation.py
Outdated
@@ -16,6 +16,42 @@ | |||
import warnings | |||
|
|||
|
|||
# has to be here (instead of cbook) to prevent circular import, since |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will never be in cbook
again; should this say _api
, or is the comment now irrelevant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah sorry, this comment was from before the _api
changes, and should definitely read _api
, not cbook.
ab249b4
to
46866fb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small docstring typo.
46866fb
to
0b71fe0
Compare
PR Summary
Needed for #18544 (GSOD). Some new machinery was needed to add the deprecation while keeping the existing API (namely, the ability to access
validJoin
as a class property directly, i.e.Line2D.validJoin
), so I pulled the necessary code out into this PR.These properties already have long-existing comments marking them as "only there for backwards compatibility", and deprecation was initially suggested by @QuLogic.
PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).