Skip to content

Commit 0b4503c

Browse files
Update autodoc defaults (#3369)
Looking between the documentation for `v2.7.0` and `v2.8.0`, all member function documentation has vanished, making it extremely difficult to utilize the documentation and for new users to be acquainted with the library. This appears to be from a [change in Sphinx](https://www.sphinx-doc.org/en/master/extdev/deprecated.html#:~:text=autodoc_default_flags,autodoc_default_options) deprecating `autodoc_default_flags` in favor of `autodoc_default_options`, which was exposed when the Sphinx version was bumped (6f0d6ef) in `requirements/docs.txt`. Let me know if I'm missing anything! Fixes #3373. --------- Co-authored-by: Enrico Minack <[email protected]>
1 parent c4ec16a commit 0b4503c

File tree

8 files changed

+17
-46
lines changed

8 files changed

+17
-46
lines changed

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@
275275
# How to display URL addresses: 'footnote', 'no', or 'inline'.
276276
# texinfo_show_urls = 'footnote'
277277

278-
autodoc_default_flags = ["members"]
278+
autodoc_default_options = {"members": True}
279279
autodoc_member_order = "bysource"
280280
autoclass_content = "both"
281281

doc/utilities.rst

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,7 @@ Logging
2121
Error Handling
2222
--------------
2323

24-
.. autoclass:: github.GithubException
25-
.. autoclass:: github.BadAttributeException
26-
.. autoclass:: github.BadCredentialsException
27-
.. autoclass:: github.TwoFactorException
28-
.. autoclass:: github.BadUserAgentException
29-
.. autoclass:: github.RateLimitExceededException
30-
.. autoclass:: github.IncompletableObject
31-
.. autoclass:: github.UnknownObjectException
24+
.. automodule:: github.GithubException
3225

3326
Default argument
3427
----------------

github/GitRelease.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ def upload_asset(
312312
self, path: str, label: str = "", content_type: Opt[str] = NotSet, name: Opt[str] = NotSet
313313
) -> github.GitReleaseAsset.GitReleaseAsset:
314314
"""
315-
:calls: `POST https://<upload_url>/repos/{owner}/{repo}/releases/{release_id}/assets <https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-assett>`_
315+
:calls: `POST https://<upload_url>/repos/{owner}/{repo}/releases/{release_id}/assets <https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-assett>`__
316316
"""
317317
assert isinstance(path, str), path
318318
assert isinstance(label, str), label
@@ -348,7 +348,7 @@ def upload_asset_from_memory(
348348
349349
Unlike ``upload_asset()`` this method allows you to pass in a file-like object to upload.
350350
Note that this method is more strict and requires you to specify the ``name``, since there's no file name to infer these from.
351-
:calls: `POST https://<upload_url>/repos/{owner}/{repo}/releases/{release_id}/assets <https://docs.github.com/en/rest/reference/repos#upload-a-release-asset>`_
351+
:calls: `POST https://<upload_url>/repos/{owner}/{repo}/releases/{release_id}/assets <https://docs.github.com/en/rest/reference/repos#upload-a-release-asset>`__
352352
:param file_like: binary file-like object, such as those returned by ``open("file_name", "rb")``. At the very minimum, this object must implement ``read()``.
353353
:param file_size: int, size in bytes of ``file_like``
354354

github/GithubIntegration.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,7 @@ def get_installation(self, owner: str, repo: str) -> Installation:
285285
"""
286286
Deprecated by get_repo_installation.
287287
288-
:calls:`GET /repos/{owner}/{repo}/installation <https://docs.github.com/en/rest/reference/apps#get-a-repository-
289-
installation-for-the-authenticated-app>`
290-
:calls:`GET /repos/{owner}/{repo}/installation <https://docs.github.com/en/rest/reference/apps#get-a-repository-
288+
:calls: `GET /repos/{owner}/{repo}/installation <https://docs.github.com/en/rest/reference/apps#get-a-repository-
291289
installation-for-the-authenticated-app>`
292290
293291
"""

github/IssueComment.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ def delete_reaction(self, reaction_id: int) -> bool:
229229

230230
def minimize(self, reason: str = "OUTDATED") -> bool:
231231
"""
232-
:calls: `POST /graphql <https://docs.github.com/en/graphql>`_ with a mutation to minimize comment
233-
<https://docs.github.com/en/graphql/reference/mutations#minimizecomment>
232+
:calls: `POST /graphql <https://docs.github.com/en/graphql>`__ with a mutation to minimize comment
233+
<https://docs.github.com/en/graphql/reference/mutations#minimizecomment>
234234
"""
235235
assert isinstance(reason, str), reason
236236
variables = {
@@ -246,8 +246,8 @@ def minimize(self, reason: str = "OUTDATED") -> bool:
246246

247247
def unminimize(self) -> bool:
248248
"""
249-
:calls: `POST /graphql <https://docs.github.com/en/graphql>`_ with a mutation to unminimize comment
250-
<https://docs.github.com/en/graphql/reference/mutations#unminimizecomment>
249+
:calls: `POST /graphql <https://docs.github.com/en/graphql>`__ with a mutation to unminimize comment
250+
<https://docs.github.com/en/graphql/reference/mutations#unminimizecomment>
251251
"""
252252
variables = {
253253
"subjectId": self.node_id,

github/MainClass.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ def get_rate_limit(self) -> RateLimitOverview:
356356
"""
357357
Rate limit overview that provides general status and status for different resources (core/search/graphql).
358358
359-
:calls:`GET /rate_limit <https://docs.github.com/en/rest/reference/rate-limit>`_
359+
:calls: `GET /rate_limit <https://docs.github.com/en/rest/reference/rate-limit>`_
360360
361361
"""
362362
headers, data = self.__requester.requestJsonAndCheck("GET", "/rate_limit")
@@ -1000,26 +1000,6 @@ def dump(self, obj: GithubObject, file: BinaryIO, protocol: int = 0) -> None:
10001000
information like the Github credentials used in the :class:`Github` instance. But NO EFFORT is made to remove
10011001
sensitive information from the object's attributes.
10021002
1003-
:param obj: the object to pickle :param file: the file-like object to pickle to :param protocol: the
1004-
`pickling protocol <https://python.readthedocs.io/en/latest/library/pickle.html#data-stream-format>`_
1005-
:param obj: the object to pickle :param file: the file-like object to pickle to :param protocol: the
1006-
`pickling protocol <https://python.readthedocs.io/en/latest/library/pickle.html#data-
1007-
:param obj: the object to pickle :param file: the file-like object to pickle to :param protocol: the
1008-
`pickling protocol <https://python.readthedocs.io/en/latest/library/pickle.html#data-
1009-
stream-format>`_ :param obj: the object to pickle :param file: the file-like object to pickle to :param
1010-
protocol: the
1011-
`pickling protocol <https://python.readthedocs.io/en/latest/library/pickle.html#data-
1012-
:param obj: the object to pickle
1013-
:param file: the file-like object to pickle to
1014-
:param protocol: the `pickling protocol <https://python.readthedocs.io/en/latest/library/pickle.html#data-
1015-
stream-format>`_
1016-
:param obj: the object to pickle
1017-
:param file: the file-like object to pickle to
1018-
:param protocol: the `pickling protocol <https://python.readthedocs.io/en/latest/library/pickle.html#data-
1019-
:param obj: the object to pickle
1020-
:param file: the file-like object to pickle to
1021-
:param protocol: the `pickling protocol <https://python.readthedocs.io/en/latest/library/pickle.html#data-
1022-
stream-format>`_
10231003
:param obj: the object to pickle
10241004
:param file: the file-like object to pickle to
10251005
:param protocol: the `pickling protocol <https://python.readthedocs.io/en/latest/library/pickle.html#data-

github/PullRequest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ def enable_automerge(
883883
) -> dict[str, Any]:
884884
"""
885885
:calls: `POST /graphql <https://docs.github.com/en/graphql>`_ with a mutation to enable pull request auto merge
886-
<https://docs.github.com/en/graphql/reference/mutations#enablepullrequestautomerge>
886+
<https://docs.github.com/en/graphql/reference/mutations#enablepullrequestautomerge>
887887
"""
888888
assert is_optional(author_email, str), author_email
889889
assert is_optional(client_mutation_id, str), client_mutation_id
@@ -917,7 +917,7 @@ def disable_automerge(
917917
) -> dict[str, Any]:
918918
"""
919919
:calls: `POST /graphql <https://docs.github.com/en/graphql>`_ with a mutation to disable pull request auto merge
920-
<https://docs.github.com/en/graphql/reference/mutations#disablepullrequestautomerge>
920+
<https://docs.github.com/en/graphql/reference/mutations#disablepullrequestautomerge>
921921
"""
922922
assert is_optional(client_mutation_id, str), client_mutation_id
923923

@@ -1013,7 +1013,7 @@ def convert_to_draft(
10131013
) -> dict[str, Any]:
10141014
"""
10151015
:calls: `POST /graphql <https://docs.github.com/en/graphql>`_ to convert pull request to draft
1016-
<https://docs.github.com/en/graphql/reference/mutations#convertpullrequesttodraft>
1016+
<https://docs.github.com/en/graphql/reference/mutations#convertpullrequesttodraft>
10171017
"""
10181018
assert is_optional(client_mutation_id, str), client_mutation_id
10191019

@@ -1038,7 +1038,7 @@ def mark_ready_for_review(
10381038
) -> dict[str, Any]:
10391039
"""
10401040
:calls: `POST /graphql <https://docs.github.com/en/graphql>`_ to mark pull request ready for review
1041-
<https://docs.github.com/en/graphql/reference/mutations#markpullrequestreadyforreview>
1041+
<https://docs.github.com/en/graphql/reference/mutations#markpullrequestreadyforreview>
10421042
"""
10431043
assert is_optional(client_mutation_id, str), client_mutation_id
10441044

github/Repository.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2515,7 +2515,7 @@ def get_deployments(
25152515
def get_deployment(self, id_: int) -> Deployment:
25162516
"""
25172517
:calls: `GET /repos/{owner}/{repo}/deployments/{deployment_id} <https://docs.github.com/en/rest/reference/repos#deployments>`_
2518-
:param: id_: int
2518+
:param: id: int
25192519
:rtype: :class:`github.Deployment.Deployment`
25202520
"""
25212521
assert isinstance(id_, int), id_
@@ -3462,7 +3462,7 @@ def get_pulls_comments(
34623462
since: Opt[datetime] = NotSet,
34633463
) -> PaginatedList[PullRequestComment]:
34643464
"""
3465-
:calls: `GET /repos/{owner}/{repo}/pulls/comments <https://docs.github.com/en/rest/reference/pulls#comments>`_
3465+
:calls: `GET /repos/{owner}/{repo}/pulls/comments <https://docs.github.com/en/rest/reference/pulls#comments>`__
34663466
:param sort: string
34673467
:param direction: string
34683468
:param since: datetime
@@ -3477,7 +3477,7 @@ def get_pulls_review_comments(
34773477
since: Opt[datetime] = NotSet,
34783478
) -> PaginatedList[PullRequestComment]:
34793479
"""
3480-
:calls: `GET /repos/{owner}/{repo}/pulls/comments <https://docs.github.com/en/rest/reference/pulls#review-comments>`_
3480+
:calls: `GET /repos/{owner}/{repo}/pulls/comments <https://docs.github.com/en/rest/reference/pulls#review-comments>`_:
34813481
:param sort: string 'created', 'updated', 'created_at'
34823482
:param direction: string 'asc' or 'desc'
34833483
:param since: datetime

0 commit comments

Comments
 (0)