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

Add bump2version #2460

Merged
merged 6 commits into from
May 5, 2022
Merged

Add bump2version #2460

merged 6 commits into from
May 5, 2022

Conversation

andreysmelter
Copy link
Contributor

WIP PR:

Partially addresses issue 2438
by bumping up source code files.

Next steps:

  • automate version bumpup in docs/*.md files

@ryanking13
Copy link
Member

ryanking13 commented May 3, 2022

Thanks, @andreysmelter! bump2version looks like very cool stuff.

I have a question. For alpha/dev versions, Python packages and JS packages have different version schemes. For example, we use 0.20.0a1 for Python package while 0.20.0-alpha.1 for JS package for alpha release.

Can we deal with this in a single command? For example, it would be great if we can do this in a config file:

# inside .bumpversion.cfg  / setup.cfg
[bumpversion]
current_version = 0.20.1
new_version_python = 0.20.1a1
new_version_js = 0.20.1-alpha.1

@hoodmane
Copy link
Member

hoodmane commented May 3, 2022

It might be better to use setuptools-scm since it has a Python interface and so we could do whatever complicated stuff we need to in a Python script rather than having to have a config file.

@rth
Copy link
Member

rth commented May 3, 2022

It might be better to use setuptools-scm since it has a Python interface and so we could do whatever complicated stuff we need to in a Python script rather than having to have a config file.

Generally, I like setuptools-scm for Python packages, but I'm not sure that's the best option here. setuptools-scm is not really going to work on non Python files (e.g. run_docker) without significant development where you provide it with some list of lines to replace and how to do that, which is what bump2version does.
Also e.g. the format {next_version}.dev{distance}+{scm letter}{revision hash} of setuptools-scm is not really appropriate for

  • js package
  • docker image
  • for the docs when pushing on the stable branch fixes after the release

So I think keeping things simple with a simple bump2version config is a start (and is already way better than what we had before). Though yes, this means that the alpha versions for the JS package need manual adjustment. If we want to go further later, we can always create a custom Python script calling bump2version in more custom ways.
BTW, it's also already parsing the latest git tag https://github.com/c4urself/bump2version/blob/bc95374d0dff73e610bed520846f88859815e532/bumpversion/cli.py#L231 though I haven't looked in detail what it does with it.

@rth
Copy link
Member

rth commented May 3, 2022

Edited the above comment to avoid confusion between the two tools :)

@andreysmelter
Copy link
Contributor Author

@rth I can take a look at this next week and continue iterating on this PR. Thanks for the comments and ideas!

Copy link
Member

@rth rth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I can confirm this works as expected. I pushed a few extra minor improvements. But yeah anyway one has to look at the git diff and often make manual adjustments before committing/tagging. Still, it's much better than the system we have now.

Merging this as a partial solution, and we can always improve it in follow up MRs (in particular to also do this in the docs with sphinx). Thanks, @andreysmelter !

@rth rth merged commit 25133af into pyodide:main May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants