-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Use bumpversion for version number management #822
Conversation
Ah, interesting idea. I didn't know about this tool. We have scripts that perform some of the same functions for our other repositories already. It might make sense to standardize on a common tool instead of custom scripts across our repositories. |
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'd be 👍 on this I think. It seems like a better approach than assigning the version programmatically like we do in other repositories. I'll raise standardization on this workflow separately.
I might have interpreted docs incorrectly, so having some clarification might help the release docs.
How about we use Requires no manual interaction - you just tag and it will automatically release (with some help of |
Using |
I added a simple pull request to demonstrate the usage. Yes, it supports releasing dev versions to pypi - thats what travis will handle for us. |
We have more than the python package version number to change, so I lean towards hard coding the version number with the tool here. In readthedocs.org repository, we read this from setup.cfg, but I think this PR is probably a better solution. I'm looking to get away from solutions that need to execute python. |
Also, I'm considering our other repositories and a more generally adopted pattern. Having a general tool like bump2version will get us more flexibility to fit the pattern in our other repositories |
The write_to option takes also write_template as option for non txt or py files. Anyway, just decide and lets go. |
I moved the configuration to setup.cfg, with the rest of the tooling configurations. I had trouble getting the parsing to work for both the current pattern that exists in this repository (`0.4.3.dev0`), and the pattern we use in other repositories (`0.4.3alpha1` and `0.4.3rc1`). The release pattern would potentially be: * Version is `0.4.3alpha1` * Bump to `0.5.0alpha1` or `0.5.0rc1` for testing release, `0.5.0` for full release * Commit, tag, etc the new release * Release to PyPI * Bump to `0.5.1alpha1` and commit. This is the next development release that would be in `master` branch
We use a 1-based indexing for dev part as `rc0` sounds funny. This was also a test commit of the change.
I made two small changes here:
|
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.
There hasn't been any opinions around adopting this across our repositories, but I'd like to at least try testing things here. I'm 👍 on this PR and hopefully we can do something similar with our other repositories.
This is an alternative for #812. It uses a CLI tool to bump the version number so we can manage it in a single place.
The benefit over #812 is that it actually writes the version number to the files, which means that we do not rely on
pkg_resources.get_distribution
(which breaks if the package is not pip-installed) and we do not read it from setup.cfg (which may cause trouble with reathedocs.org code)I hope that this PR contributes to the speed at which we can release dev builds, so we can get better and earlier feedback.
Release instructions have been updated, but the process is:
bump2version [major|minor|patch|dev]
. Usingmajor|minor|patch
will always have adev0
suffix, usingdev
will bump the number in the suffix (dev0
->dev1
->dev2
)bump2version --allow-dirty release
to remove thedevX
suffix. The--allow-dirty
flag is needed to prevent complaints about non-committed changes.