Skip to content

Docs source links on GitHub - #8743

Draft
Jens Hedegaard Nielsen (jenshnielsen) wants to merge 5 commits into
microsoft:mainfrom
jenshnielsen:docs-source-links-on-github
Draft

Jens Hedegaard Nielsen (jenshnielsen) wants to merge 5 commits into
microsoft:mainfrom
jenshnielsen:docs-source-links-on-github

Conversation

@jenshnielsen

Copy link
Copy Markdown
Collaborator

Reduce size and speed up docs builds by linking to code on github rather than embedding it

@codecov

codecov Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.44444% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.45%. Comparing base (8b80845) to head (1f2e635).

Files with missing lines Patch % Lines
...rc/qcodes/sphinx_extensions/github_source_links.py 94.44% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8743      +/-   ##
==========================================
+ Coverage   75.42%   75.45%   +0.03%     
==========================================
  Files         308      309       +1     
  Lines       32734    32788      +54     
==========================================
+ Hits        24689    24740      +51     
- Misses       8045     8048       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jenshnielsen
Jens Hedegaard Nielsen (jenshnielsen) force-pushed the docs-source-links-on-github branch 3 times, most recently from 709a37f to e0017e8 Compare November 9, 2026 19:21
sphinx.ext.viewcode renders a highlighted source page for each of the
~230 documented modules. Each of these pages includes the full furo
navigation tree, which is expensive to compute, so they added about a
minute to a serial (Windows) docs build.

Use sphinx.ext.linkcode to link to the source on GitHub instead. The
link points to the tag of a release, or to the commit embedded in the
version of a development build, so that it matches the documented
code. Line numbers are found with the same parser that viewcode uses.
Unlike viewcode, inherited members now link to the base class
definition.
Move the linkcode_resolve logic out of docs/conf.py into
qcodes.sphinx_extensions.github_source_links so that it is type checked
and can be tested, and add tests for it. conf.py now only creates the
function with make_linkcode_resolve.

Also drop the handling of decorated functions and cached properties.
functools.wraps already copies the module and qualified name used for
the lookup, and cached properties are only used for private attributes,
which are not documented.
Fixes the blind-except lint error and formats the new tests.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant