Skip to content

Matt/script py release#695

Merged
Matt Perpick (clutchski) merged 38 commits into
mainfrom
matt/script-py-release
May 16, 2025
Merged

Matt/script py release#695
Matt Perpick (clutchski) merged 38 commits into
mainfrom
matt/script-py-release

Conversation

@clutchski

@clutchski Matt Perpick (clutchski) commented May 15, 2025

Copy link
Copy Markdown
Collaborator

This PR automates the release of the python SDK and cleans up our python make targets a bit.

Caveats

Usage

How you'd do a release:

  • bump the version.py and merge the PR to main
  • verify integration tests pass and do any manual testing you want. ready to release
  • Trigger a build by pushing the current version as a release tag.
matt@bt1:~/code/bt/braintrust/sdk/py(matt/script-py-release)$ vim src/braintrust/version.py                                                                                                                                                                                            1 ↵
matt@bt1:~/code/bt/braintrust/sdk/py(matt/script-py-release)$ ./scripts/push-release-tag.sh
================================================
 Python SDK Release
================================================
version:      v0.1.1
commit:       8802026c
code:         https://github.com/braintrustdata/braintrust-sdk/commit/8802026c
changeset:    https://github.com/braintrustdata/braintrust-sdk/compare/v0.1.0...8802026c


Are you ready to release version 0.1.1? Type 'YOLO' to continue:

This triggers the autopublish workflow, which is watching for pushes to tags like vXYZ. This job does some validation that the tag is sane, matches version.py and then builds the wheel, tests the wheel and publishes to testpypi.

If this works, I'll add PyPI soon.

@clutchski Matt Perpick (clutchski) marked this pull request as ready for review May 15, 2025 16:44
Comment thread py/scripts/publish.sh
Comment thread py/scripts/push-release-tag.sh Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thank you for your service 🫡

left some nits but nothing blocking

Comment thread py/scripts/validate-release-tag.sh Outdated
Comment on lines +50 to +51
# FIXME[matt] remove this once we're onmain
# exit 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

im assuming you'll do this in a followup PR?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yes

Comment thread py/src/braintrust/test_version.py
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "$@"
else
sed -i "$@"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

gnu sed is best sed
image

Comment thread Makefile Outdated
Comment thread py/scripts/push-release-tag.sh Outdated
Comment thread py/scripts/push-release-tag.sh Outdated
Comment on lines +47 to +49
- name: Validate release tag
run: |
./py/scripts/validate-release-tag.sh "$RELEASE_TAG"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There appears to be a mismatch in how the RELEASE_TAG is passed to the validation script. The script validate-release-tag.sh expects RELEASE_TAG as an environment variable, but it's being passed as a command-line argument.

To fix this, consider changing the line to:

RELEASE_TAG=$RELEASE_TAG ./py/scripts/validate-release-tag.sh

This ensures the script receives the value through the environment as expected.

Suggested change
- name: Validate release tag
run: |
./py/scripts/validate-release-tag.sh "$RELEASE_TAG"
- name: Validate release tag
run: |
RELEASE_TAG=$RELEASE_TAG ./py/scripts/validate-release-tag.sh

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

@clutchski Matt Perpick (clutchski) merged commit e6b72cf into main May 16, 2025
10 checks passed
@clutchski Matt Perpick (clutchski) deleted the matt/script-py-release branch May 16, 2025 14:38
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