forked from Qiskit/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Future proof release notes and migration guide links before Qiskit 1.0 (
Qiskit#804) When Qiskit 1.0 is released, a bunch of APIs will be removed from our Qiskit API docs. This breaks internal links we have. This PR switches all links that will break to point to Qiskit 0.44. Once 1.0 is released, we should switch what we can to 0.46, per Qiskit#803. It does not change Qiskit release notes for 0.45 and 0.46, since we can't safely make manual changes to those, per Qiskit#755. Those still need to be dealt with. ## How change was generated I found the issues by generating 1.0 docs as the current version, then running `npm run check:links -- --qiskit-release-notes`. I started with manual fixes, then realized this is easily automatable. I accidentally `git clean`ed the script, but it looked like this: ```python from pathlib import Path from typing import DefaultDict from collections import defaultdict import re def parse_error(error: str, file_to_bad_links: DefaultDict[str, list[str]]) -> None: lines = error.splitlines() bad_link_line = lines[0] file_list_lines = lines[1:] bad_link = "" # Regex that captured the link files = [line.split("❓")[0].strip() for line in file_list_lines] for file in files: file_to_bad_links[file].append(bad_link) def read_errors() -> DefaultDict[str, list[str]]: raw_text = Path("api_errors.txt").read_text() file_to_bad_links = defaultdict(list) for error in raw_text.split("❌"): parse_error(error, file_to_bad_links) return file_to_bad_links def rewrite_file(fp: str, bad_links: list[str]) -> None: # code to use `string.replace()` pass def main() -> None: file_to_bad_links = read_errors() for file, bad_links in file_to_bad_links.items(): rewrite_file(file, bad_links) main() ``` Then I had to fix a few links manually that were only in 0.45 and not 0.44.
- Loading branch information
1 parent
a0cba69
commit b2350a7
Showing
26 changed files
with
336 additions
and
335 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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.