Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENHANCEMENT] argilla: define argilla-v1 as optional dependency #5120

Merged
merged 3 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion argilla/docs/how_to_guides/migrate_from_legacy_datasets.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ The guide will take you through three steps:

### Step 1: Retrieve the legacy dataset

Connect to the Argilla V1 server via the new `argilla` package. The new sdk contains a `v1` module that allows you to connect to the Argilla V1 server:
Connect to the Argilla V1 server via the new `argilla` package. First, you should install an extra dependency:
```bash
pip install "argilla[v1]"
```

Now, you can use the `v1` module to connect to the Argilla V1 server.
```python
import argilla.v1 as rg_v1

Expand Down
6 changes: 5 additions & 1 deletion argilla/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dynamic = ["version"]
dependencies = [
"httpx>=0.26.0",
"pydantic>=2.6.0, <3.0.0",
"argilla-v1[listeners]",

"tqdm>=4.60.0",
"rich>=10.0.0",
]
Expand All @@ -23,6 +23,10 @@ io = [
"datasets>=2.0.0",
]

v1 = [
"argilla-v1[listeners]",
]

[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
Expand Down
9 changes: 7 additions & 2 deletions argilla/src/argilla/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@

import warnings

from argilla_v1 import * # noqa
try:
from argilla_v1 import * # noqa
except ModuleNotFoundError as ex:
raise Exception(
'The package argilla-v1 is not installed. Please install it by typing: pip install "argilla[v1]"',
) from ex


def deprecation(message: str):
Expand All @@ -23,5 +28,5 @@ def deprecation(message: str):

deprecation(
"The module `argilla_sdk.v1` has been include for migration purposes. "
"It's deprecated and will be removed in the future"
"It's deprecated and will be removed in the future."
)
Loading