Derive package version from git tags via setuptools-scm#131
Merged
Conversation
Removes the manually maintained __version__.py file. Version is now read from git tags at build time by setuptools-scm, so cutting a GitHub release is the only step needed to publish a new version.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit dba5e59. Configure here.
joeybaer
approved these changes
May 22, 2026
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Summary
customerio/__version__.pywithsetuptools-scm, which derives the version from git tags at build timeclient_base.pyandtests/test_api.pyto useimportlib.metadata.version()instead of importing the now-deleted__version__modulefetch-depth: 0to the publish workflow so setuptools-scm can read git tags during CI buildsRelease flow after this change
vX.Y.Zsetuptools-scmreads the tag → builds with the correct version → publishes to PyPINo code changes needed per release.
Test plan
pytest— 59 tests passruff check— cleanimportlib.metadata.version("customerio")resolves correctly from editable installNote
Low Risk
Release/versioning workflow change with no auth or API behavior changes; main risk is mis-versioned builds if tags or shallow checkout are wrong, mitigated by fetch-depth: 0 on publish/CI.
Overview
Replaces the hand-maintained
customerio/__version__.pywith setuptools-scm, so the package version comes from git tags at build/install time instead of a committed constant.Build and packaging:
pyproject.tomladdssetuptools-scmto the build backend, configures[tool.setuptools_scm], and removes the oldtool.setuptools.dynamicattr-based version. Runtime and tests read the installed distribution version viaimportlib.metadata.version("customerio")inclient_base.pyandtests/test_api.py.CI:
actions/checkoutin main (lint, test, package) and publish workflows now usesfetch-depth: 0so full git history/tags are available for setuptools-scm during editable installs and PyPI builds.Reviewed by Cursor Bugbot for commit 37abcff. Bugbot is set up for automated code reviews on this repo. Configure here.