-
Notifications
You must be signed in to change notification settings - Fork 86
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
Add objects.inv #522
Add objects.inv #522
Conversation
UpdateThe following links are broken according to the link checker:
|
scripts/lib/links/ignores.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the number of broken links is low enough I can ignore them here rather than disabling checking completely. The advantages are:
- We're less likely to forget about
objects.inv
when we decide to address the broken links - We'll still be alerted to new broken links in future
objects.inv
files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work, thank you Frank! Just one question, I was testing it regenerating a historical version and the script generated the file public/api/qiskit/0.44
instead of public/api/qiskit/0.44/objects.inv
. Is that the intended behavior?
I think the reason is the extname
thinks .44 is the extension of a file and it doesn't join the path with objects.inv
in objectsInv.ts
.
async write(path: string): Promise<void> {
if (extname(path) === "") {
path = join(path, "objects.inv");
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Thanks for enabling the link checker - good call. I think this is ready to merge after addressing Arnau's concern.
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Thanks both for the reviews! @arnaucasau good catch with the historical apis script; it's working now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing job 🙌
if (filePath.endsWith(".inv")) { | ||
return await parseObjectsInv(filePath); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect 🙌
The API generation script is now able to work with `objects.inv` files thanks to @frankharkins at #522. This PR allows us to copy over the objects.file when we want to make a version historical running `npm run make-historical -- -p <projectName>`.
This is prework for Qiskit#522, which adds `sphinx.inv`. We want to check the links contained in `sphinx.inv`, but we don't expect anyone to have links pointing to `sphinx.inv`. Our original abstractions made it hard to model `objects.inv` correctly with the link checker. Now, `markdown.ts` is renamed to `extractLinks.ts` and it solely deals with parsing files. It no longer has a bad coupling to the complex `linksToOriginFiles` variable from `FileBatch.ts`. This should make it much more obvious how to handle `objects.inv`. --------- Co-authored-by: Frank Harkins <frankharkins@hotmail.co.uk>
- Added `objectsInv.ts` to read, decompress, and parse `objects.inv` files (and vice versa) - Updated `updateApiDocs.ts` to copy the file over from the artifact - Added logic to transform links and delete any references that don't exist in our docs ### Explanation The `objects.inv` file is an index that [intersphinx](https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html) uses to create cross-references to our documentation. To allow other projects to cross-reference Qiskit, we need to host this file. For a description of the file's data structure, see the [sphobjinv documentation](https://sphobjinv.readthedocs.io/en/stable/syntax.html), whose implementation I copied when working out how to transform this file. --------- Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
The API generation script is now able to work with `objects.inv` files thanks to @frankharkins at Qiskit#522. This PR allows us to copy over the objects.file when we want to make a version historical running `npm run make-historical -- -p <projectName>`.
objectsInv.ts
to read, decompress, and parseobjects.inv
files (and vice versa)updateApiDocs.ts
to copy the file over from the artifactExplanation
The
objects.inv
file is an index that intersphinx uses to create cross-references to our documentation. To allow other projects to cross-reference Qiskit, we need to host this file.For a description of the file's data structure, see the sphobjinv documentation, whose implementation I copied when working out how to transform this file.