From 006498b33cb6662f5925e3146f2733362be10910 Mon Sep 17 00:00:00 2001 From: Francisco Aranda Date: Thu, 27 Jun 2024 15:03:53 +0200 Subject: [PATCH 1/3] chore: Define argilla-v1 depencency as optional --- argilla/pyproject.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/argilla/pyproject.toml b/argilla/pyproject.toml index 114ce0bdf3..b445ba7263 100644 --- a/argilla/pyproject.toml +++ b/argilla/pyproject.toml @@ -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", ] @@ -23,6 +23,10 @@ io = [ "datasets>=2.0.0", ] +v1 = [ + "argilla-v1[listeners]", +] + [build-system] requires = ["pdm-backend"] build-backend = "pdm.backend" From ea0ad131817c622444e925a74d431e3420beac3d Mon Sep 17 00:00:00 2001 From: Francisco Aranda Date: Thu, 27 Jun 2024 15:04:40 +0200 Subject: [PATCH 2/3] chore: catch import error and raise a more specific error --- argilla/src/argilla/v1/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/argilla/src/argilla/v1/__init__.py b/argilla/src/argilla/v1/__init__.py index 75284d237e..3ad81a537f 100644 --- a/argilla/src/argilla/v1/__init__.py +++ b/argilla/src/argilla/v1/__init__.py @@ -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): @@ -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." ) From 93c430fec8edd8c0b0fee6afc461226d3606f826 Mon Sep 17 00:00:00 2001 From: Francisco Aranda Date: Thu, 27 Jun 2024 15:11:58 +0200 Subject: [PATCH 3/3] chore: Update docs --- argilla/docs/how_to_guides/migrate_from_legacy_datasets.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/argilla/docs/how_to_guides/migrate_from_legacy_datasets.md b/argilla/docs/how_to_guides/migrate_from_legacy_datasets.md index ad8d513e62..5b5c9a7a79 100644 --- a/argilla/docs/how_to_guides/migrate_from_legacy_datasets.md +++ b/argilla/docs/how_to_guides/migrate_from_legacy_datasets.md @@ -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