-
Check the issues and PRs to see if the feature/bug has already been requested/fixed. If not, open an issue. This helps us keep track of feature requests and bugs!
-
If you're having issues, the best way we can help is when you can share a reproducible example.
-
In general, it's helpful to use this format:
<short description of the issue> <link to your project> <system info, including weave version, python version, and OS> <reproducible code snippet> <any other info you think is relevant> -
For SDK issues, a reproducible script like example_error_script.py is helpful. We use
uvwhich can run the script with the dependencies included. If you know the dependencies, you can add them to the script. See theuvdocs for more details.
-
- If you are a first-time contributor, welcome! To get started, make a fork and point to the main
weaverepo:git clone https://github.com/<your-username>/weave.git cd weave git remote add upstream https://github.com/wandb/weave.git
- Build!
- Keep your fork up to date with the main
weaverepo:git checkout master git pull upstream master
- Create a branch for your changes:
git checkout -b <your-username>/<your-branch>
- Commit changes to your branch and push:
git add your_file.py git commit -m "feat(integrations): Add new integration for <your-package>" git push origin <your-username>/<your-branch>
- Open a PR!
- Keep your fork up to date with the main
All PR titles should conform to the Conventional Commits spec. Conventional Commits is a lightweight convention on top of commit messages.
Structure
The commit message should be structured as follows:
<type>(<scope>): <description>Only certain types are permitted.
⭐ User-facing notes such as `fix` and `feat` should be written so that a user can clearly understand the changes. If the feature or fix does not directly impact users, consider using a different type. Examples can be found in the section below.| Type | Name | Description | User-facing? |
|---|---|---|---|
| feat | ✨ Feature | Changes that add new functionality that directly impacts users | Yes |
| fix | 🐛 Fix | Changes that fix existing issues | Yes |
| refactor | 💎 Code Refactor | A code change that neither fixes a bug nor adds a new feature | No |
| style | 💅 Style | Changes that do not affect the meaning of the code (e.g. linting) | Maybe |
| chore | ⚙️ Chores | Changes that do not modify source code (e.g. CI configuration files, build scripts) | No |
| revert | ♻️ Reverts | Reverts a previous commit | Maybe |
| security | 🔒 Security | Security fix/feature | Maybe |
We use:
uvfor package and env management -- follow the uv guide to bootstrap an environmentcurl -LsSf https://astral.sh/uv/install.sh | shnoxfor running testsuv tool install nox
We recommend installing the package in editable mode:
uv pip install -e .We use pre-commit. You can install with:
uv tool install pre-commitThen run on staged files (default, faster):
pre-commit run --hook-stage=pre-pushOr run on all files (slower but more thorough):
pre-commit run --hook-stage=pre-push --all-filesYou can also use the lint nox target to run linting:
# Run on staged files only (default, faster)
nox -e lint
# Run on all files
nox -e lint -- --all-filesUse uv:
uv buildWe use pytest and nox to run tests. To see a list of test environments:
nox -lThen to run a specific environment:
nox -e "$TARGET_ENV" # e.g. nox -e "tests-3.12(shard='trace')"Tests are split up into shards, which include:
trace-- all of the trace SDK teststrace_server-- tests for trace server backend- various integrations, like
openai,instructor, etc -- these envs are isolated to simplify testing
Nox is the most thorough way to run the tests, as it sets important environment variables needed to run specific integrations and shards. However, it is slower. A combination of uv and pytest can be used for faster iteration when your code is agnostic to integration type, python version, etc.
uv sync --group test --active
uv run pytestFor even faster iteration, it is possible to limit scope to a single file or test. For example:
uv run pytest tests/trace/test_weave_client.pyor
uv run pytest tests/trace/test_weave_client.py::test_table_createweave is moving quickly, and sometimes features need to be deprecated.
To deprecate a feature, use the deprecated decorator from weave.trace.util. This is currently used primarily for renames.
from weave.trace.util import deprecated
@deprecated("new_func_name")
def old_func():
pass