|
2 | 2 |
|
3 | 3 | import os |
4 | 4 | import sys |
5 | | -import warnings |
6 | 5 |
|
7 | 6 | # ============================================================================= |
8 | | -# DEPRECATION NOTICE |
| 7 | +# SDK 2.0 ANNOUNCEMENT |
9 | 8 | # ============================================================================= |
10 | | -_DEPRECATION_MESSAGE = """ |
| 9 | +_ANNOUNCEMENT_MESSAGE = """ |
11 | 10 | ================================================================================ |
12 | | -DEPRECATION WARNING: The 'together' package is deprecated and will no longer |
13 | | -be maintained after January 2026. |
14 | | -
|
15 | | -Please migrate to the new SDK: https://github.com/togethercomputer/together-py |
| 11 | +Together Python SDK 2.0 is now available! |
16 | 12 |
|
| 13 | +Install: pip install --pre together |
| 14 | +New SDK: https://github.com/togethercomputer/together-py |
17 | 15 | Migration guide: https://docs.together.ai/docs/pythonv2-migration-guide |
| 16 | +
|
| 17 | +This package will be maintained until January 2026. |
18 | 18 | ================================================================================ |
19 | 19 | """ |
20 | 20 |
|
21 | | -# Show deprecation warning (visible to developers with warnings enabled) |
22 | | -warnings.warn( |
23 | | - "The 'together' package is deprecated and will no longer be maintained after " |
24 | | - "January 2026. Please migrate to the new SDK: " |
25 | | - "https://github.com/togethercomputer/together-py " |
26 | | - "Migration guide: https://docs.together.ai/docs/pythonv2-migration-guide", |
27 | | - DeprecationWarning, |
28 | | - stacklevel=2, |
29 | | -) |
30 | | - |
31 | | -# Also print a visible notice to stderr (unless suppressed) |
32 | | -if not os.environ.get("TOGETHER_SUPPRESS_DEPRECATION_WARNING"): |
| 21 | +# Show info banner (unless suppressed) |
| 22 | +if not os.environ.get("TOGETHER_NO_BANNER"): |
33 | 23 | try: |
34 | 24 | from rich.console import Console |
35 | 25 | from rich.panel import Panel |
36 | 26 |
|
37 | 27 | console = Console(stderr=True) |
38 | 28 | console.print( |
39 | 29 | Panel( |
40 | | - "[bold yellow]DEPRECATION WARNING[/bold yellow]\n\n" |
41 | | - "The [cyan]together[/cyan] package is deprecated and will no longer " |
42 | | - "be maintained after [bold]January 2026[/bold].\n\n" |
43 | | - "Please migrate to the new SDK:\n" |
44 | | - "[link=https://github.com/togethercomputer/together-py]" |
45 | | - "https://github.com/togethercomputer/together-py[/link]\n\n" |
46 | | - "Migration guide:\n" |
47 | | - "[link=https://docs.together.ai/docs/pythonv2-migration-guide]" |
| 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]" |
48 | 37 | "https://docs.together.ai/docs/pythonv2-migration-guide[/link]\n\n" |
49 | | - "[dim]Set TOGETHER_SUPPRESS_DEPRECATION_WARNING=1 to hide this message.[/dim]", |
50 | | - title="⚠️ Deprecation Notice", |
51 | | - border_style="yellow", |
| 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", |
52 | 42 | ) |
53 | 43 | ) |
54 | 44 | except ImportError: |
55 | 45 | # Fallback if rich is not available |
56 | | - print(_DEPRECATION_MESSAGE, file=sys.stderr) |
| 46 | + print(_ANNOUNCEMENT_MESSAGE, file=sys.stderr) |
57 | 47 |
|
58 | 48 | # ============================================================================= |
59 | 49 |
|
|
0 commit comments