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

replace custom version handling with setuptools-scm #1322

Merged

Conversation

dhellmann
Copy link
Contributor

@dhellmann dhellmann commented Apr 3, 2025

SUMMARY:

Use setuptools-scm to automatically compute a version based on the
latest git tag.

Remove the old logic for reading a static file to get the version
string, but configure setuptools-scm to generate a similar file for
anyone who wants to import it to get the version information.

Replace the build_type value set in code with an environment variable
so setup.py can continue to change the versioning scheme based on the
type of build being performed.

When the BUILD_TYPE is "nightly", produce an alpha release for the
next version, with the date as the alpha version. For example, when
the most recent tag is 0.4.1 the nightly release version built on 3
Apr 2025 is 0.4.2a20250403.

When the BUILD_TYPE is "release", if the commit being built has a tag
use that tag's value as the version.

When the BUILD_TYPE is "dev", or if the commit being built does not
have a tag, or the git repository has pending changes, compute a
development version combining the distance since the last tag with the
expected next tag. For example, if the most recent tag is 0.4.1 and
there have been 74 commits since that tag and the most recent commit
SHA is 5e2c1c92, then the version would be 0.4.2.dev74+g5e2c1c92. If
the local git repository has modified files that are not committed,
the date is appended in the local version field, giving
0.4.2.dev74+g5e2c1c92.d20250403.

TEST PLAN:

I tested this change locally using these commands

$ BUILD_TYPE=nightly python3 -m build .
$ python3 -m build .

And using a variety of clean, dirty, and tagged commits.

@dhellmann dhellmann force-pushed the switch-versioning-to-setuptools-scm branch 2 times, most recently from e5967d0 to ea3ddec Compare April 3, 2025 22:21
@dhellmann dhellmann force-pushed the switch-versioning-to-setuptools-scm branch from ea3ddec to a3e45e1 Compare April 4, 2025 17:54
@dhellmann dhellmann force-pushed the switch-versioning-to-setuptools-scm branch from a3e45e1 to 958a5d2 Compare April 4, 2025 19:15
@dhellmann dhellmann force-pushed the switch-versioning-to-setuptools-scm branch from 958a5d2 to 0adba4f Compare April 4, 2025 19:33
@dhuangnm dhuangnm requested a review from dsikka April 7, 2025 19:29
dbarbuzzi
dbarbuzzi previously approved these changes Apr 8, 2025
@dhellmann dhellmann dismissed stale reviews from brian-dellabetta and dbarbuzzi via 7611a63 April 8, 2025 18:35
@dhellmann dhellmann force-pushed the switch-versioning-to-setuptools-scm branch from 0adba4f to 7611a63 Compare April 8, 2025 18:35
@dhellmann
Copy link
Contributor Author

How do I run that linter locally so I can check the formatting before pushing?

@brian-dellabetta
Copy link
Collaborator

How do I run that linter locally so I can check the formatting before pushing?

@dhellmann you can use make style, provided by the Makefile. You'll have to pip install the [dev] extras_require

@dhuangnm
Copy link
Collaborator

dhuangnm commented Apr 8, 2025

@dhellmann I just realized we need to update the Makefile as well according to the build changes. Can you please update it too? Thanks.

@dhellmann
Copy link
Contributor Author

@dhellmann I just realized we need to update the Makefile as well according to the build changes. Can you please update it too? Thanks.

What updates are needed there?

@dhellmann dhellmann force-pushed the switch-versioning-to-setuptools-scm branch from 7611a63 to fc204fe Compare April 8, 2025 18:54
@dhellmann
Copy link
Contributor Author

@dhellmann I just realized we need to update the Makefile as well according to the build changes. Can you please update it too? Thanks.

What updates are needed there?

Nevermind, I figured it out as soon as I got set up to run make style. :-)

@dhellmann
Copy link
Contributor Author

I think this is ready for testing again, if someone could approve it, please.

@dhellmann dhellmann force-pushed the switch-versioning-to-setuptools-scm branch 2 times, most recently from 4c5558d to 8581008 Compare April 9, 2025 12:41
@dhellmann dhellmann force-pushed the switch-versioning-to-setuptools-scm branch from 8581008 to 32cd313 Compare April 9, 2025 20:06
dhuangnm
dhuangnm previously approved these changes Apr 9, 2025
Copy link
Collaborator

@dhuangnm dhuangnm left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@dhellmann dhellmann force-pushed the switch-versioning-to-setuptools-scm branch 2 times, most recently from 86b578f to 9717dce Compare April 10, 2025 15:27
@dhellmann
Copy link
Contributor Author

I have fixed the linter issue and rebased, so need approval on the workflow to run the tests again.

dhuangnm
dhuangnm previously approved these changes Apr 10, 2025
Copy link
Collaborator

@dhuangnm dhuangnm left a comment

Choose a reason for hiding this comment

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

Thanks.

Use setuptools-scm to automatically compute a version based on the
latest git tag.

Remove the old logic for reading a static file to get the version
string, but configure setuptools-scm to generate a similar file for
anyone who wants to import it to get the version information.

Replace the build_type value set in code with an environment variable
so setup.py can continue to change the versioning scheme based on the
type of build being performed.

When the BUILD_TYPE is "nightly", produce an alpha release for the
_next_ version, with the date as the alpha version. For example, when
the most recent tag is 0.4.1 the nightly release version built on 3
Apr 2025 is 0.4.2a20250403.

When the BUILD_TYPE is "release", if the commit being built has a tag
use that tag's value as the version.

When the BUILD_TYPE is "dev", or if the commit being built does not
have a tag, or the git repository has pending changes, compute a
development version combining the distance since the last tag with the
expected next tag. For example, if the most recent tag is 0.4.1 and
there have been 74 commits since that tag and the most recent commit
SHA is 5e2c1c92, then the version would be 0.4.2.dev74+g5e2c1c92. If
the local git repository has modified files that are not committed,
the date is appended in the local version field, giving
0.4.2.dev74+g5e2c1c92.d20250403.

When the BUILD_TYPE is "release", depend on the pinned version of
compressed-tensors. Otherwise, let the version float so that dev and
CI environments can control it.

Signed-off-by: Doug Hellmann <[email protected]>
@dhellmann dhellmann force-pushed the switch-versioning-to-setuptools-scm branch from 9717dce to b0ea85f Compare April 10, 2025 20:58
@dsikka dsikka added the ready When a PR is ready for review label Apr 10, 2025
@dsikka dsikka enabled auto-merge (squash) April 10, 2025 21:25
@dsikka dsikka merged commit 8fdd0a1 into vllm-project:main Apr 10, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready When a PR is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants