Skip to content

Docs: Test presence of optional extensions with importlib - #130445

Merged
AA-Turner merged 1 commit into
python:mainfrom
AA-Turner:docs/conf-py-importlib
Feb 22, 2025
Merged

AA-Turner merged 1 commit into
python:mainfrom
AA-Turner:docs/conf-py-importlib

Conversation

@AA-Turner

@AA-Turner AA-Turner commented Feb 22, 2025 •

Copy link
Copy Markdown
Member

We don't need to import the extensions, and this is more compact if we add more optional extensions.

A


📚 Documentation preview 📚: https://cpython-previews--130445.org.readthedocs.build/

@AA-Turner AA-Turner added docs Documentation in the Doc dir skip issue skip news needs backport to 3.12 only security fixes needs backport to 3.13 only security fixes labels Feb 22, 2025
@AA-Turner
AA-Turner requested a review from hugovk as a code owner February 22, 2025 06:02
Comment thread Doc/conf.py
extensions.append(optional_ext)
except (ImportError, ValueError):
pass
del _OPTIONAL_EXTENSIONS

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this make much difference?

Suggested change
del _OPTIONAL_EXTENSIONS

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We should avoid polluting the conf.py namespace, as it is read for Sphinx configuration. The underscore and del may be overkill, but just being explicit.

@AA-Turner
AA-Turner merged commit 3cc9e86 into python:main Feb 22, 2025
@miss-islington-app

Copy link
Copy Markdown

Thanks @AA-Turner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 22, 2025
…30445)

(cherry picked from commit 3cc9e86)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@bedevere-app

bedevere-app Bot commented Feb 22, 2025

Copy link
Copy Markdown

GH-130464 is a backport of this pull request to the 3.13 branch.

@miss-islington-app

Copy link
Copy Markdown

Sorry, @AA-Turner, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 3cc9e867eba1ed139cf28c74b4a788bcc4801394 3.12

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Feb 22, 2025
AA-Turner added a commit to AA-Turner/cpython that referenced this pull request Feb 22, 2025
…honGH-130445)

(cherry picked from commit 3cc9e86)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@bedevere-app

bedevere-app Bot commented Feb 22, 2025

Copy link
Copy Markdown

GH-130466 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Feb 22, 2025
@AA-Turner
AA-Turner deleted the docs/conf-py-importlib branch February 22, 2025 18:00
AA-Turner added a commit that referenced this pull request Feb 22, 2025
…130445) (#130464)

(cherry picked from commit 3cc9e86)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
AA-Turner added a commit that referenced this pull request Feb 22, 2025
…130445) (#130466)

* [3.12] Docs: Test presence of optional extensions with importlib (GH-130445)
(cherry picked from commit 3cc9e86)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip issue skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants