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

[Version] Refactor version updating logic #82

Merged
merged 3 commits into from
Mar 17, 2023
Merged

Conversation

comaniac
Copy link
Contributor

Description

I realized that I forgot to bump the version in slapo/version.py to v0.0.2.dev0 in the last release. This results in some confusions, because when user install Slapo from source, they still see v0.0.1.dev0. This PR refactors the version updating logic to prevent this case from happening again in the future release.

  1. Make slapo/version.py the only place to specify the current dev version.
  2. Add a sanity check when building a wheel. Specifically, if it attempts to update the version from v0.0.x.dev0 in version.py to v0.0.y where y != x , then errors out. This is used to make sure we bump the version in version.py before releasing a new stable version.
  3. Align the version when installing with setup.py.

In short, with this PR we now have the following behaviors:

  1. When installing from source (e.g., pip3 install -e ".[dev]"), the version shown by pip3 show slapo would be the formal version (e.g., 0.0.2.dev13+g44aea26). Note that since we didn't change slapo/version.py, we will still see 0.0.2.dev0 if python3 -c "import slapo; print(slapo.__version__)". This is intentional.
  2. Before building a wheel for release, build_wheel.sh invokes update_version.py, which modifies slapo/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 release v0.0.3, before adding a tag to the repo, we require the version specified in slapo/version.py to be 0.0.3.dev0; otherwise update_version.py will error out.

Checklist

  • PR's title starts with a category (e.g. [Bugfix], [Model], [Tutorial], etc)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage
  • Code is well-documented

cc @chhzh123

Copy link
Contributor

@chhzh123 chhzh123 left a comment

Choose a reason for hiding this comment

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

LGTM

@comaniac comaniac merged commit ea203f3 into awslabs:main Mar 17, 2023
@comaniac
Copy link
Contributor Author

Thanks @chhzh123

@comaniac comaniac deleted the version branch March 17, 2023 16:37
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.

2 participants