From 66008ab85415357f2a36e8269f20431d61804054 Mon Sep 17 00:00:00 2001 From: aelkheir <90580077+aelkheir@users.noreply.github.com> Date: Tue, 1 Jul 2025 15:09:30 +0300 Subject: [PATCH 1/6] Fix source linking (closes #4838). --- docs/auxil/sphinx_hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/auxil/sphinx_hooks.py b/docs/auxil/sphinx_hooks.py index 47fd9c9281c..899b49aef6b 100644 --- a/docs/auxil/sphinx_hooks.py +++ b/docs/auxil/sphinx_hooks.py @@ -55,7 +55,7 @@ } -FILE_ROOT = Path(inspect.getsourcefile(telegram)).parent.parent.resolve() +FILE_ROOT = Path(inspect.getsourcefile(telegram)).parent.parent.parent.resolve() def autodoc_skip_member(app, what, name, obj, skip, options): From 3d049bea9f7aa1833194804a729ca062b54f9475 Mon Sep 17 00:00:00 2001 From: aelkheir <90580077+aelkheir@users.noreply.github.com> Date: Tue, 1 Jul 2025 12:14:18 +0000 Subject: [PATCH 2/6] Add chango fragment for PR #4839 --- changes/unreleased/4839.gExNhF7C6kR5VrBg6cBaar.toml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changes/unreleased/4839.gExNhF7C6kR5VrBg6cBaar.toml diff --git a/changes/unreleased/4839.gExNhF7C6kR5VrBg6cBaar.toml b/changes/unreleased/4839.gExNhF7C6kR5VrBg6cBaar.toml new file mode 100644 index 00000000000..74272eb6724 --- /dev/null +++ b/changes/unreleased/4839.gExNhF7C6kR5VrBg6cBaar.toml @@ -0,0 +1,5 @@ +documentation = "Documentation improvements." +[[pull_requests]] +uid = "4839" +author_uid = "aelkheir" +closes_threads = ["4838"] From d77ea7c59bd7b5b5fdb2e90285d3cb3086513da4 Mon Sep 17 00:00:00 2001 From: aelkheir <90580077+aelkheir@users.noreply.github.com> Date: Tue, 1 Jul 2025 15:19:08 +0300 Subject: [PATCH 3/6] Elaborate on chango fragment for PR. --- changes/unreleased/4839.gExNhF7C6kR5VrBg6cBaar.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/changes/unreleased/4839.gExNhF7C6kR5VrBg6cBaar.toml b/changes/unreleased/4839.gExNhF7C6kR5VrBg6cBaar.toml index 74272eb6724..cb93ea41ab9 100644 --- a/changes/unreleased/4839.gExNhF7C6kR5VrBg6cBaar.toml +++ b/changes/unreleased/4839.gExNhF7C6kR5VrBg6cBaar.toml @@ -1,4 +1,7 @@ -documentation = "Documentation improvements." +documentation = """Documentation improvements. + +* Fix [source] linking. +""" [[pull_requests]] uid = "4839" author_uid = "aelkheir" From f7708c9f7122a98a2042a8b7a71ddeaf2a6c1c32 Mon Sep 17 00:00:00 2001 From: aelkheir <90580077+aelkheir@users.noreply.github.com> Date: Tue, 1 Jul 2025 17:55:32 +0300 Subject: [PATCH 4/6] Unify source file discovery accross installation setups. --- docs/auxil/sphinx_hooks.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/auxil/sphinx_hooks.py b/docs/auxil/sphinx_hooks.py index 899b49aef6b..62d8613c8b0 100644 --- a/docs/auxil/sphinx_hooks.py +++ b/docs/auxil/sphinx_hooks.py @@ -55,7 +55,9 @@ } -FILE_ROOT = Path(inspect.getsourcefile(telegram)).parent.parent.parent.resolve() +# Resolves to the parent directory of `telegram/`, depending on installation setup, +# could either be `/src` or `/site-packages` +FILE_ROOT = Path(inspect.getsourcefile(telegram)).parent.parent.resolve() def autodoc_skip_member(app, what, name, obj, skip, options): @@ -161,7 +163,7 @@ def autodoc_process_docstring( with contextlib.suppress(Exception): source_lines, start_line = inspect.getsourcelines(obj) end_line = start_line + len(source_lines) - file = Path(inspect.getsourcefile(obj)).relative_to(FILE_ROOT) + file = Path("src") / Path(inspect.getsourcefile(obj)).relative_to(FILE_ROOT) LINE_NUMBERS[name] = (file, start_line, end_line) # Since we don't document the `__init__`, we call this manually to have it available for From 4e403f8d2deac65aba7abbbc339348da11433415 Mon Sep 17 00:00:00 2001 From: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com> Date: Wed, 2 Jul 2025 19:37:10 +0200 Subject: [PATCH 5/6] update an outdated link --- src/telegram/_bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/telegram/_bot.py b/src/telegram/_bot.py index 56072fbe0d6..87766f95ace 100644 --- a/src/telegram/_bot.py +++ b/src/telegram/_bot.py @@ -3176,7 +3176,7 @@ async def send_venue( google_place_id (:obj:`str`, optional): Google Places identifier of the venue. google_place_type (:obj:`str`, optional): Google Places type of the venue. (See `supported types \ - `_.) + `_.) disable_notification (:obj:`bool`, optional): |disable_notification| protect_content (:obj:`bool`, optional): |protect_content| From 8658686a1bd132e8257e268c6afaeb2670e84959 Mon Sep 17 00:00:00 2001 From: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com> Date: Sat, 5 Jul 2025 16:32:38 +0200 Subject: [PATCH 6/6] remove superfluous dunder methods from constants docs --- docs/source/telegram.constants.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/source/telegram.constants.rst b/docs/source/telegram.constants.rst index ef1e6720107..618b35246f1 100644 --- a/docs/source/telegram.constants.rst +++ b/docs/source/telegram.constants.rst @@ -5,5 +5,4 @@ telegram.constants Module :members: :show-inheritance: :no-undoc-members: - :inherited-members: Enum, EnumMeta, str, int, float :exclude-members: __format__, __new__, __repr__, __str__