Skip to content
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

Merged
merged 8 commits into from
Feb 8, 2024

Conversation

arnaucasau
Copy link
Collaborator

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

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`,
Copy link
Collaborator Author

@arnaucasau arnaucasau Feb 8, 2024

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

Copy link
Collaborator

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.

Copy link
Collaborator Author

@arnaucasau arnaucasau Feb 8, 2024

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

@arnaucasau arnaucasau marked this pull request as ready for review February 8, 2024 12:04
@arnaucasau arnaucasau requested review from Eric-Arellano and removed request for Eric-Arellano February 8, 2024 14:00
@arnaucasau arnaucasau marked this pull request as draft February 8, 2024 14:01
Copy link
Collaborator

@Eric-Arellano Eric-Arellano left a 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.

README.md Outdated Show resolved Hide resolved
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`,
Copy link
Collaborator

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.

arnaucasau and others added 3 commits February 8, 2024 15:14
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
@arnaucasau arnaucasau marked this pull request as ready for review February 8, 2024 14:41
Copy link
Collaborator

@Eric-Arellano Eric-Arellano left a 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.

@arnaucasau arnaucasau added this pull request to the merge queue Feb 8, 2024
Merged via the queue into Qiskit:main with commit 36e6f14 Feb 8, 2024
2 checks passed
@arnaucasau arnaucasau deleted the AC/add-dev-version branch February 8, 2024 16:41
frankharkins pushed a commit to frankharkins/documentation that referenced this pull request Jul 22, 2024
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants