Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork871
Explain how to add an extension module#1350
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
46 commits Select commitHold shift + click to select a range
086ded3
explain how to add modules
picnixz96fb998
Update extension-modules.rst
picnixz5f8797c
Update extension-modules.rst
picnixze5d41f8
Update extension-modules.rst
picnixzb740114
Update extension-modules.rst
picnixzc74df67
Update extension-modules.rst
picnixze645869
Update extension-modules.rst
picnixz5a9a57c
Update extension-modules.rst
picnixz26a18eb
Update extension-modules.rst
picnixz1b4d73f
Update extension-modules.rst
picnixz94086dd
Address Hugo's feedback
picnixz9a78a3b
Update extension-modules.rst
picnixze22c278
Update extension-modules.rst
picnixz1f51497
improvements
picnixzbdf09e5
fixup! sphinx
picnixzef7cf3e
fixup! indents
picnixz1a405ba
fixup! warnings
picnixze39cbc2
improve sections
picnixz35f207f
fix markup
picnixz316b00d
improve titles
picnixz523dece
improve presentation
picnixzd1cdd1d
fixup! markup
picnixzdefb31e
simplify snippets
picnixz6213438
improvements
picnixzf6e5d55
improvements
picnixzd1a1ed5
some rewordings and cleanups
picnixz86e3e54
simplify wording
picnixz65f62e7
address Erlend's review
picnixz4b7c7d8
fix indents?
picnixz7abb6f1
add ref to clinic everywhere when needed
picnixzda9b58b
fix typos
picnixz783e6db
address encukou's review
picnixz8906ebd
improve the page flow
picnixz128c81c
use sentence case
picnixz7d6c8d6
add podman tip
picnixz01c25bc
address rest of the review
picnixz56910fb
address Alyssa's review
picnixz3ee1cea
add details
picnixz3d235f4
address review
picnixz7b0b234
Make it easier to update the required ubuntu version
picnixz7fa94bf
Merge remote-tracking branch 'upstream/main' into add-extensions-tuto…
picnixzec48fdb
fixup!
picnixz1843e3d
fixup!
picnixz18c4d91
improve comment
picnixz8224bbd
use double quotes instead of single quotes
picnixz2f63053
Address Carol's review.
picnixzFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
28 changes: 28 additions & 0 deletions_extensions/ubuntu_version.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"""Sphinx extension to update the required Ubuntu version. | ||
The required Ubuntu version should be specified in conf.py by:: | ||
configure_ubuntu_version = "MAJOR.MINOR" # e.g., "22.04" | ||
The version must match the one used to regenerate the configure script in | ||
https://github.com/python/cpython/blob/main/Tools/build/regen-configure.sh. | ||
""" | ||
from sphinx.errors import ExtensionError | ||
def replace_ubuntu_version(app, docname, source): | ||
"""Replace all occurrences of $CONFIGURE_UBUNTU_VERSION$. | ||
This is needed since RST replacement via ``|...|`` is not supported | ||
in code-blocks directives. | ||
""" | ||
if (ubuntu_version := app.config.configure_ubuntu_version) is None: | ||
raise ExtensionError("configure_ubuntu_version is not set in conf.py") | ||
source[0] = source[0].replace("$CONFIGURE_UBUNTU_VERSION$", ubuntu_version) | ||
def setup(app): | ||
app.add_config_value("configure_ubuntu_version", None, "env", types=(str,)) | ||
app.connect("source-read", replace_ubuntu_version) | ||
return {"parallel_read_safe": True, "parallel_write_safe": True} |
8 changes: 8 additions & 0 deletionsconf.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.