Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

docs: update docstrings with deprecated directive #1178

Merged
merged 9 commits into from
Apr 15, 2024
Merged

docs: update docstrings with deprecated directive #1178

merged 9 commits into from
Apr 15, 2024

Conversation

IronCore864
Copy link
Contributor

@IronCore864 IronCore864 commented Apr 8, 2024

Update docstrings to use sphinx deprecated directive.

ops/charm.py Show resolved Hide resolved
@IronCore864 IronCore864 marked this pull request as ready for review April 12, 2024 03:29
Copy link
Contributor

@tonyandrewmeyer tonyandrewmeyer left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

What do you & @benhoyt think about putting a deprecation notice on OpenedPort here as well? With a message to use Port instead, and the version either 2.13 as an official deprecation or 2.7 which is when it essentially was?

@benhoyt
Copy link
Collaborator

benhoyt commented Apr 12, 2024

A deprecation notice on OpenedPort sounds good to me!

@IronCore864
Copy link
Contributor Author

It seems if I add a docstring on a global variable:

OpenedPort = Port
"""Alias for backwards compatibility.

.. deprecated:: 2.7.0
    Use :class:`Port` instead.
"""

it does not show up in sphinx autodoc.
Shall I make it a new class so that I can add a docstrig to it?

class OpenedPort(Port):
    """Alias for backwards compatibility.

    .. deprecated:: 2.7.0
        Use :class:`Port` instead.
    """

ops/model.py Outdated Show resolved Hide resolved
….com:IronCore864/operator into update-docstring-to-use-deprecated-directive
@IronCore864 IronCore864 requested a review from benhoyt April 15, 2024 01:54
Copy link
Collaborator

@benhoyt benhoyt left a comment

Choose a reason for hiding this comment

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

Thanks for the updates!

@IronCore864 IronCore864 merged commit ac21f47 into canonical:main Apr 15, 2024
28 checks passed
@IronCore864 IronCore864 deleted the update-docstring-to-use-deprecated-directive branch April 15, 2024 04:18
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants