8000 gh-126609: Revert commit cbfd3924 to fix errors by StanFromIreland · Pull Request #129479 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-126609: Revert commit cbfd3924 to fix errors #129479

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "[3.12] GH-121970: Extract availability into a new extensi…
…on (GH-125082) (#125238)"

This reverts commit caa4924
  • Loading branch information
StanFromIreland committed Jan 30, 2025
commit 9c0620a59e0a94f4cc13b203c3cc6e2719fd3a35
34 changes: 6 additions & 28 deletions Doc/tools/extensions/pyspecific.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
ISSUE_URI = 'https://bugs.python.org/issue?@action=redirect&bpo=%s'
GH_ISSUE_URI = 'https://github.com/python/cpython/issues/%s'
# Used in conf.py and updated here by python/release-tools/run_release.py
SOURCE_URI = 'https://github.com/python/cpython/tree/main/%s'
SOURCE_URI = 'https://github.com/python/cpython/tree/3.12/%s'

# monkey-patch reST parser to disable alphabetic and roman enumerated lists
from docutils.parsers.rst.states import Body
Expand Down Expand Up @@ -184,22 +184,7 @@ def run(self):
return PyMethod.run(self)


# Support for documenting version of changes, additions, deprecations

def expand_version_arg(argument, release):
"""Expand "next" to the current version"""
if argument == 'next':
return sphinx_gettext('{} (unreleased)').format(release)
return argument


class PyVersionChange(VersionChange):
def run(self):
# Replace the 'next' special token with the current development version
self.arguments[0] = expand_version_arg(self.arguments[0],
self.config.release)
return super().run()

# Support for documenting version of removal in deprecations

class DeprecatedRemoved(VersionChange):
required_arguments = 2
Expand All @@ -210,12 +195,8 @@ class DeprecatedRemoved(VersionChange):
def run(self):
# Replace the first two arguments (deprecated version and removed version)
# with a single tuple of both versions.
version_deprecated = expand_version_arg(self.arguments[0],
self.config.release)
version_deprecated = self.arguments[0]
version_removed = self.arguments.pop(1)
if version_removed == 'next':
raise ValueError(
'deprecated-removed:: second argument cannot be `next`')
self.arguments[0] = version_deprecated, version_removed

# Set the label based on if we have reached the removal version
Expand Down Expand Up @@ -278,8 +259,8 @@ def run(self):
# Support for building "topic help" for pydoc

pydoc_topic_labels = [
'assert', 'assignment', 'assignment-expressions', 'async', 'atom-identifiers',
'atom-literals', 'attribute-access', 'attribute-references', 'augassign', 'await',
'assert', 'assignment', 'async', 'atom-identifiers', 'atom-literals',
'attribute-access', 'attribute-references', 'augassign', 'await',
'binary', 'bitwise', 'bltin-code-objects', 'bltin-ellipsis-object',
'bltin-null-object', 'bltin-type-objects', 'booleans',
'break', 'callable-types', 'calls', 'class', 'comparisons', 'compound',
Expand Down Expand Up @@ -417,15 +398,12 @@ def setup(app):
app.add_role('issue', issue_role)
app.add_role('gh', gh_issue_role)
app.add_directive('impl-detail', ImplementationDetail)
app.add_directive('versionadded', PyVersionChange, override=True)
app.add_directive('versionchanged', PyVersionChange, override=True)
app.add_directive('versionremoved', PyVersionChange, override=True)
app.add_directive('deprecated', PyVersionChange, override=True)
app.add_directive('deprecated-removed', DeprecatedRemoved)
app.add_builder(PydocTopicsBuilder)
app.add_object_type('opcode', 'opcode', '%s (opcode)', parse_opcode_signature)
app.add_object_type('pdbcommand', 'pdbcmd', '%s (pdb command)', parse_pdb_command)
app.add_object_type('monitoring-event', 'monitoring-event', '%s (monitoring event)', parse_monitoring_event)
app.add_object_type('2to3fixer', '2to3fixer', '%s (2to3 fixer)')
app.add_directive_to_domain('py', 'decorator', PyDecoratorFunction)
app.add_directive_to_domain('py', 'decoratormethod', PyDecoratorMethod)
app.add_directive_to_domain('py', 'coroutinefunction', PyCoroutineFunction)
Expand Down
0