-
Notifications
You must be signed in to change notification settings - Fork 368
refactor: separate deprecated config for readability #628
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
refactor: separate deprecated config for readability #628
Conversation
7c55328
to
9dae53c
Compare
ebffc5f
to
41f3d09
Compare
41f3d09
to
3134fc7
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.
LGTM, one comment about making sure version numbers are in deprecation messages
oauthenticator/bitbucket.py
Outdated
help=""" | ||
Allow members of selected Bitbucket teams to sign in. | ||
""", | ||
help="Deprecated, use :attr:`.BitbucketOAuthenticator.allowed_teams`.", |
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.
I've learned that it's a good practice to always have in VERSION
everywhere you have a 'deprecated' or 'removed' message, so that folks who see it know how to coordinate the deprecations with their version requirements without having to dig around and find the relevant version where things changed.
Thanks for reviewing @minrk! I was thinking "should I write "Deprecated in 0.12" or "Deprecated in v0.12" and searched for examples in jupyterhub/jupyterhub, where I found the following: @minrk do you think
|
Yeah, since it gets rendered in docs, that makes sense.
Hm. A few options - you could use the deprecated admonition and put "this has been removed" in the body, like:
or use or even try this extension so we could use
No, |
Thanks @minrk! I've opened sphinx-doc/sphinx#11480 about |
I've concluded that if we use an extension like that, it can be done without installing a new dependency with this in conf.py. # -- Add versionremoved directive ---------------------------------------------------
# ref: https://github.com/sphinx-doc/sphinx/issues/11480
#
from sphinx.domains.changeset import VersionChange, versionlabel_classes, versionlabels
def setup(app):
if "versionremoved" not in versionlabels:
versionlabels["versionremoved"] = "Removed in version %s"
versionlabel_classes["versionremoved"] = "removed"
app.add_directive("versionremoved", VersionChange) The downside is that it doesn't render nicely, because its theme dependent as well based on this in pydata-sphinx-theme. |
Since it's simple like that, I think it's fine. Good find! It's probably not that often that we'll have attributes that are still present and documented but 'removed'. |
Thanks for reviewing @minrk!!! |
Some classes had quite a bit of no longer relevant config, and since they also had long help strings it was a bit tricky to overview effectively what was relevant. With this PR I've:
_deprecated_oauth_aliases
list of deprecated config and the deprecated/removed config to the end of config declarations"[Deprecated|Removed], use :attr:`.<class>.<new_config>`"
stringsCode refactoring preview
Config reference docs preview