Skip to content

Commit

Permalink
chore(weave): Dry Run Script (#3460)
Browse files Browse the repository at this point in the history
* Added basic script

* Added basic script

* Added basic script
  • Loading branch information
tssweeney authored Jan 22, 2025
1 parent ced95e1 commit 7b2b7e0
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion dev_docs/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
37 changes: 37 additions & 0 deletions weave/scripts/prerelease_dry_run.py
Original file line number Diff line number Diff line change
@@ -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")

0 comments on commit 7b2b7e0

Please sign in to comment.