diff --git a/Makefile b/Makefile index 6c1ed017c0f9..364e61b53b32 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,9 @@ docs: build: uv build +prerelease-dry-run: + uv run ./weave/scripts/prerelease_dry_run.py + prepare-release: docs build synchronize-base-object-schemas: diff --git a/dev_docs/RELEASE.md b/dev_docs/RELEASE.md index 6514f9d6730b..dcbba003e864 100644 --- a/dev_docs/RELEASE.md +++ b/dev_docs/RELEASE.md @@ -4,7 +4,9 @@ This document outlines how to publish a new Weave release to our public [PyPI pa 1. Verify the head of master is ready for release and announce merge freeze to the Weave team while the release is being published (Either ask an admin on the Weave repo to place a freeze on https://www.mergefreeze.com/ or use the mergefreeze Slack app if it is set up or just post in Slack) -2. You should also run through this [sample notebook](https://colab.research.google.com/drive/1DmkLzhFCFC0OoN-ggBDoG1nejGw2jQZy#scrollTo=29hJrcJQA7jZ) remember to install from master. You can also just run the [quickstart](http://wandb.me/weave_colab). +2. Manual Verifications: + - Run `make prerelease-dry-run` to verify that the dry run script works. + - You should also run through this [sample notebook](https://colab.research.google.com/drive/1DmkLzhFCFC0OoN-ggBDoG1nejGw2jQZy#scrollTo=29hJrcJQA7jZ) remember to install from master. You can also just run the [quickstart](http://wandb.me/weave_colab). 3. To prepare a PATCH release, go to GitHub Actions and run the [bump-python-sdk-version](https://github.com/wandb/weave/actions/workflows/bump_version.yaml) workflow on master. This will: diff --git a/weave/scripts/prerelease_dry_run.py b/weave/scripts/prerelease_dry_run.py new file mode 100644 index 000000000000..81370525ead2 --- /dev/null +++ b/weave/scripts/prerelease_dry_run.py @@ -0,0 +1,37 @@ +# /// script +# requires-python = ">=3.9" +# dependencies = [ +# "weave @ git+https://github.com/wandb/weave.git@master", +# ] +# /// + +# Run this script with `uv run prerelease_dry_run.py` + +import datetime + +import weave + +# This uniq id ensures that the op is not cached +uniq_id = datetime.datetime.now().timestamp() + + +@weave.op +def func(a: int) -> float: + return a + uniq_id + + +def main() -> None: + client = weave.init("test-project") + res = func(42) + + client._flush() + calls = func.calls() + + assert len(calls) == 1 + assert calls[0].output == res + assert calls[0].inputs == {"a": 42} + + +if __name__ == "__main__": + main() + print("Dry run passed")