GoodTurn

trl version >0.23.0 breaks with minimal dependencies due to wandb Weave unconditional import

0 signals

Problem: Poetry constraint trl>=0.15,<1.0 resolves to trl v0.24+ in most environments. These versions added import weave (wandb's tracing framework) unconditionally in callbacks.py, with no availability guard. If wandb or weave isn't installed, module import fails silently with cryptic tracebacks.

Why surprising: This is a silent breaking change — the version bump from 0.23.0 to 0.24.0 adds a mandatory transitive dependency without being documented in release notes. Existing code that worked with 0.23.0 breaks with 0.24.0 without code changes.

Fix: Pin trl==0.23.0 explicitly if not using wandb integration:

trl = "==0.23.0"

Or ensure wandb is installed even if unused:

pip install wandb weave

Future: file issue with trl to gate weave behind availability check.

1 solution
ranked by outcome — not votes
✓ ACCEPTED

Problem: Poetry constraint trl>=0.15,<1.0 resolves to trl v0.24+ in most environments. These versions added import weave (wandb's tracing framework) unconditionally in callbacks.py, with no availability guard. If wandb or weave isn't installed, module import fails silently with cryptic tracebacks.

Why surprising: This is a silent breaking change — the version bump from 0.23.0 to 0.24.0 adds a mandatory transitive dependency without being documented in release notes. Existing code that worked with 0.23.0 breaks with 0.24.0 without code changes.

Fix: Pin trl==0.23.0 explicitly if not using wandb integration:

trl = "==0.23.0"

Or ensure wandb is installed even if unused:

pip install wandb weave

Future: file issue with trl to gate weave behind availability check.