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

Fix version bumping for pre-releases #1610

Merged
merged 10 commits into from
Jun 27, 2022
Merged

Fix version bumping for pre-releases #1610

merged 10 commits into from
Jun 27, 2022

Conversation

jtpio
Copy link
Member

@jtpio jtpio commented Jun 23, 2022

Running the Draft Changelog on the main branch failed with the following error:

Error: Could not parse 0.8.0a0 as a valid version string

https://github.com/jtpio/jupyter_releaser/runs/7023597896?check_suite_focus=true

This looks related to bumping the version for pre-releases.

This change should fix it.

@jtpio jtpio added this to the 0.8.0 milestone Jun 23, 2022
@jtpio
Copy link
Member Author

jtpio commented Jun 23, 2022

This is what it looks like locally running tbump --non-interactive --only-patch 0.8.0a0:

image

@jtpio
Copy link
Member Author

jtpio commented Jun 23, 2022

Currently the version in the top-level package.json is set to 0.8.0:

"version": "0.8.0",

But for 0.8.0a0 it should be set to the corresponding 0.8.0-alpha.0.

@brichet
Copy link
Contributor

brichet commented Jun 23, 2022

Currently the version in the top-level package.json is set to 0.8.0:

"version": "0.8.0",

But for 0.8.0a0 it should be set to the corresponding 0.8.0-alpha.0.

I agree, do you think there is a way to do that using tbump ?

@jtpio
Copy link
Member Author

jtpio commented Jun 23, 2022

I agree, do you think there is a way to do that using tbump ?

hmm not sure.

But an alternative could be to run a small script as a after-bump-version hook doing something like this:

version.replace('a', '-alpha.').replace('b', '-beta.').replace('rc', '-rc.')

Similar to the cookiecutter but the other way around: https://github.com/jupyterlab/extension-cookiecutter-ts/blob/a706ffd9d5d2c2813c427d571caaab77014dae17/%7B%7Bcookiecutter.python_name%7D%7D/setup.py#L40-L45

And write the modified version back to package.json.

@brichet
Copy link
Contributor

brichet commented Jun 23, 2022

And write the modified version back to package.json.

It seems that the 2 hooks available in tbumb are before_commit and after_push.
If we modify the package.json file, don't you think that tbump will complain with a Current version string not found error on the next release.
We need a before_bump hook to reverse it.

@jtpio
Copy link
Member Author

jtpio commented Jun 23, 2022

Right I meant a Jupyter Releaser hook.

Just pushed e69c9b5 to try something along these lines, will check what the check release CI job does.

@brichet
Copy link
Contributor

brichet commented Jun 23, 2022

Nice @jtpio

In tools/post-bump.py l20 is that not "-dev" instead of "dev" ?

@jtpio
Copy link
Member Author

jtpio commented Jun 24, 2022

Thanks @brichet makes sense for consistency. Updated in 4a606ea

@jtpio
Copy link
Member Author

jtpio commented Jun 24, 2022

Looks like the nbextensions checks are now failing.

Restarting them to see if they are just flaky.

@brichet
Copy link
Contributor

brichet commented Jun 24, 2022

This is related to selenium.webdriver :
E AttributeError: 'WebDriver' object has no attribute 'find_elements_by_css_selector'
The current version of selenium is 4.3.0. With the 4.2.0 the tests were passing.
As this branch will not support nbextension, we can just lock the version of selenium==4.2.0 for this PR, and open an issue in the 0.7.x branch.

@jtpio
Copy link
Member Author

jtpio commented Jun 24, 2022

Ah indeed it looks like selenium 4.3.0 was released today:

image

Maybe we can fix it by pinning on 4.2.0 in a separate PR since it's likely to affect other PRs? Happy to rebase this one afterwards.

@brichet
Copy link
Contributor

brichet commented Jun 24, 2022

Maybe we can fix it by pinning on 4.2.0 in a separate PR since it's likely to affect other PRs? Happy to rebase this one afterwards.

Done in #1611

@jtpio jtpio marked this pull request as ready for review June 24, 2022 15:13
@jtpio
Copy link
Member Author

jtpio commented Jun 27, 2022

@brichet this PR was rebased and CI is now passing, if you would like to have another look.

Happy to attempt a new release right after to see if that goes better that time.

@brichet
Copy link
Contributor

brichet commented Jun 27, 2022

@brichet this PR was rebased and CI is now passing, if you would like to have another look.

Happy to attempt a new release right after to see if that goes better that time.

Everything seems OK for me.

@jtpio
Copy link
Member Author

jtpio commented Jun 27, 2022

Alright then let's get it in and I'll start the pre-release process right after.

@jtpio jtpio merged commit 9c4f339 into jupyter:main Jun 27, 2022
@jtpio jtpio deleted the fix-bump branch June 27, 2022 12:34
@jtpio
Copy link
Member Author

jtpio commented Jun 27, 2022

Looks like the "Draft Changelog" workflow went through this time: #1613

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants