Skip to content

Commit 8309314

Browse files
authored
add deprecation notices (#404)
* add deprecation notices * update toml * info instead of warning * wip
1 parent e465a0e commit 8309314

File tree

3 files changed

+80
-1
lines changed

3 files changed

+80
-1
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,34 @@
44
</a>
55
</div>
66

7+
> [!NOTE]
8+
> ## 🚀 Together Python SDK 2.0 is now available!
9+
>
10+
> Check out the new SDK: **[together-py](https://github.com/togethercomputer/together-py)**
11+
>
12+
> 📖 **Migration Guide:** [https://docs.together.ai/docs/pythonv2-migration-guide](https://docs.together.ai/docs/pythonv2-migration-guide)
13+
>
14+
> ### Install the Beta
15+
>
16+
> **Using uv (Recommended):**
17+
> ```bash
18+
> # Install uv if you haven't already
19+
> curl -LsSf https://astral.sh/uv/install.sh | sh
20+
>
21+
> # Install together python SDK
22+
> uv add together --prerelease allow
23+
>
24+
> # Or upgrade an existing installation
25+
> uv sync --upgrade-package together --prerelease allow
26+
> ```
27+
>
28+
> **Using pip:**
29+
> ```bash
30+
> pip install --pre together
31+
> ```
32+
>
33+
> This package will be maintained until January 2026.
34+
735
# Together Python API library
836
937
[![PyPI version](https://img.shields.io/pypi/v/together.svg)](https://pypi.org/project/together/)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ build-backend = "poetry.masonry.api"
1414
name = "together"
1515
version = "1.5.31"
1616
authors = ["Together AI <[email protected]>"]
17-
description = "Python client for Together's Cloud Platform!"
17+
description = "Python client for Together's Cloud Platform! Note: SDK 2.0 is now available at https://github.com/togethercomputer/together-py"
1818
readme = "README.md"
1919
license = "Apache-2.0"
2020
classifiers = [

src/together/__init__.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,56 @@
11
from __future__ import annotations
22

3+
import os
4+
import sys
5+
6+
# =============================================================================
7+
# SDK 2.0 ANNOUNCEMENT
8+
# =============================================================================
9+
_ANNOUNCEMENT_MESSAGE = """
10+
================================================================================
11+
Together Python SDK 2.0 is now available!
12+
13+
Install: pip install --pre together
14+
New SDK: https://github.com/togethercomputer/together-py
15+
Migration guide: https://docs.together.ai/docs/pythonv2-migration-guide
16+
17+
This package will be maintained until January 2026.
18+
================================================================================
19+
"""
20+
21+
# Show info banner (unless suppressed)
22+
if not os.environ.get("TOGETHER_NO_BANNER"):
23+
try:
24+
from rich.console import Console
25+
from rich.panel import Panel
26+
27+
console = Console(stderr=True)
28+
console.print(
29+
Panel(
30+
"[bold cyan]Together Python SDK 2.0 is now available![/bold cyan]\n\n"
31+
"Install the beta:\n"
32+
"[green]pip install --pre together[/green] or "
33+
"[green]uv add together --prerelease allow[/green]\n\n"
34+
"New SDK: [link=https://github.com/togethercomputer/together-py]"
35+
"https://github.com/togethercomputer/together-py[/link]\n"
36+
"Migration guide: [link=https://docs.together.ai/docs/pythonv2-migration-guide]"
37+
"https://docs.together.ai/docs/pythonv2-migration-guide[/link]\n\n"
38+
"[dim]This package will be maintained until January 2026.\n"
39+
"Set TOGETHER_NO_BANNER=1 to hide this message.[/dim]",
40+
title="🚀 New SDK Available",
41+
border_style="cyan",
42+
)
43+
)
44+
except Exception:
45+
# Fallback for any error (ImportError, OSError in daemons, rich errors, etc.)
46+
# Banner display should never break module imports
47+
try:
48+
print(_ANNOUNCEMENT_MESSAGE, file=sys.stderr)
49+
except Exception:
50+
pass # Silently ignore if even stderr is unavailable
51+
52+
# =============================================================================
53+
354
from contextvars import ContextVar
455
from typing import TYPE_CHECKING, Callable
556

0 commit comments

Comments
 (0)