- 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
uv
which can run the script with the dependencies included. If you know the dependencies, you can add them to the script. See theuv
docs for more details.
- In general, it's helpful to use this format:
- If you are a first-time contributor, welcome! To get started, make a fork and point to the main
weave
repo: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
weave
repo: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 |
docs | 📜 Documentation | Documentation changes only | Maybe |
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:
uv
for package and env management -- follow the uv guide to bootstrap an environmentcurl -LsSf https://astral.sh/uv/install.sh | sh
nox
for 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-commit
Then run:
pre-commit run --hook-stage=pre-push --all-files
You can also use the lint
nox target to run linting.
nox -e lint
Use uv
:
uv build
We use pytest and nox to run tests. To see a list of test environments:
nox -l
Then 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
weave
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