-
Notifications
You must be signed in to change notification settings - Fork 85
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
Extend the API generation script to generate dev versions #779
Conversation
scripts/commands/updateApiDocs.ts
Outdated
const devRegex = /[0-9](-rc|-dev)/; | ||
if (args.dev && !args.version.match(devRegex)) { | ||
throw new Error( | ||
`${args.package} ${args.version} is not a correct dev version. Please make sure the version has one of the following suffixes with a hyphen immediately following the patch version: -rc, -dev. e.g. 1.0.0-rc1 or 1.0.0-dev`, |
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.
Following the semver specification we need to have a hyphen between the patch version and the prerelease identifiers. I tested it and without it, we won't be able to sort the versions without adding extra logic to the version selector code.
For more information: https://semver.org/#spec-item-9
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.
For rc1, there is no -
, e.g. 1.0.0rc1
. See https://pypi.org/project/qiskit/#history. We need to use the version from the actual release because that's what users have to put into their Python install.
So we'll need to adapt the internal code to work around this.
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.
Thanks for pointing that out! I changed the script to accept release candidate versions without the dash, but this is something super important to make sure we correct when we read the version from the _package.json
on ... because otherwise, it will break components that are not able to recognize it
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.
Looks great! The link checker and page render-er need dev support. I can push a commit.
scripts/commands/updateApiDocs.ts
Outdated
const devRegex = /[0-9](-rc|-dev)/; | ||
if (args.dev && !args.version.match(devRegex)) { | ||
throw new Error( | ||
`${args.package} ${args.version} is not a correct dev version. Please make sure the version has one of the following suffixes with a hyphen immediately following the patch version: -rc, -dev. e.g. 1.0.0-rc1 or 1.0.0-dev`, |
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.
For rc1, there is no -
, e.g. 1.0.0rc1
. See https://pypi.org/project/qiskit/#history. We need to use the version from the actual release because that's what users have to put into their Python install.
So we'll need to adapt the internal code to work around this.
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
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.
Nice! Please double check my commit to change the link checker.
This PR adds support to generate dev versions for the API generation script. For the moment, the automatic regeneration will not take into account dev versions to keep this PR easy to review. I'll add support for that in a follow-up, together with the documentation of the dev versions. Part of Qiskit#316 --------- Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
This PR adds support to generate dev versions for the API generation script.
For the moment, the automatic regeneration will not take into account dev versions to keep this PR easy to review. I'll add support for that in a follow-up, together with the documentation of the dev versions.
Part of #316