Skip to content

Test API generation with a Sphinx 9.1.0 artifact#4605

Draft
arnaucasau wants to merge 5 commits intomainfrom
AC/test-sphinx-9
Draft

Test API generation with a Sphinx 9.1.0 artifact#4605
arnaucasau wants to merge 5 commits intomainfrom
AC/test-sphinx-9

Conversation

@arnaucasau
Copy link
Collaborator

@arnaucasau arnaucasau commented Jan 29, 2026

Builds off #4603

This PR is a test to verify that the API generation script can generate the docs from Sphinx v9 artifacts. See Qiskit/qiskit#15615

The generation can be found in 0742f01

### run

<Function id="qiskit.primitives.BaseEstimatorV2.run" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/primitives/base/base_estimator.py#L78-L93" signature="run(pubs, *, precision=None)" modifiers="abstract">
<Function id="qiskit.primitives.BaseEstimatorV2.run" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/primitives/base/base_estimator.py#L78-L93" signature="run(pubs, *, precision=None)" modifiers="abstractmethod">
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

New abstractmethod modifier

##### new

<Function id="qiskit.circuit.classical.expr.Var.new" signature="new(ty)">
<Function id="qiskit.circuit.classical.expr.Var.new" signature="new(name, ty)" modifiers="classmethod">
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

New classmethod modifier

#### ExperimentalFeatures

<Class id="qiskit.qasm3.ExperimentalFeatures" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/qasm3/experimental.py#L21-L70" signature="qiskit.qasm3.ExperimentalFeatures(value)" modifiers="class">
<Class id="qiskit.qasm3.ExperimentalFeatures" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/qasm3/experimental.py#L21-L70" signature="qiskit.qasm3.ExperimentalFeatures(*values)" modifiers="class">
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The signature arguments are now positional lists in some cases

### name

<Attribute id="qiskit.circuit.library.GRZ.name" attributeTypeHint="str">
<Attribute id="qiskit.circuit.library.GRZ.name">
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The type hint was missing from the HTML compared to other artifacts. Specifically this part:

<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.14)"><span class="pre">str</span></a>

### sort\_key

<Attribute id="qiskit.dagcircuit.DAGDepNode.sort_key" attributeTypeHint="str" />
<Attribute id="qiskit.dagcircuit.DAGDepNode.sort_key" />
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It seems like we recovered every type hint, but we now lost the ones from this file

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, seems like the type annotations in DAGDepNode are only inline in the __init__ method, which makes them opaque to Sphinx. I'll move them into class-level annotations to make it work again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants