[Version] Refactor version updating logic #82
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I realized that I forgot to bump the version in
slapo/version.py
tov0.0.2.dev0
in the last release. This results in some confusions, because when user install Slapo from source, they still seev0.0.1.dev0
. This PR refactors the version updating logic to prevent this case from happening again in the future release.slapo/version.py
the only place to specify the current dev version.v0.0.x.dev0
in version.py tov0.0.y
wherey != x
, then errors out. This is used to make sure we bump the version inversion.py
before releasing a new stable version.setup.py
.In short, with this PR we now have the following behaviors:
pip3 install -e ".[dev]"
), the version shown bypip3 show slapo
would be the formal version (e.g.,0.0.2.dev13+g44aea26
). Note that since we didn't changeslapo/version.py
, we will still see0.0.2.dev0
ifpython3 -c "import slapo; print(slapo.__version__)"
. This is intentional.build_wheel.sh
invokesupdate_version.py
, which modifiesslapo/version.py
to be the current version. Thus, the version specified in the wheel reflects the current commit. With the sanity check added in this PR, assuming we are going to releasev0.0.3
, before adding a tag to the repo, we require the version specified inslapo/version.py
to be0.0.3.dev0
; otherwiseupdate_version.py
will error out.Checklist
cc @chhzh123