Skip to content

Commit

Permalink
[ENHANCEMENT] argilla: define argilla-v1 as optional dependency (#5120
Browse files Browse the repository at this point in the history
)

# Pull Request Template
<!-- Please include a summary of the changes and the related issue.
Please also include relevant motivation and context. List any
dependencies that are required for this change. -->

This PR defines `argilla-v1` as an optional dependency. 

Closes #5096

**Type of change**
<!-- Please delete options that are not relevant. Remember to title the
PR according to the type of change -->

- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- Refactor (change restructuring the codebase without changing
functionality)
- Improvement (change adding some improvement to an existing
functionality)
- Documentation update

**How Has This Been Tested**
<!-- Please add some reference about how your feature has been tested.
-->

**Checklist**
<!-- Please go over the list and make sure you've taken everything into
account -->

- I added relevant documentation
- follows the style guidelines of this project
- I did a self-review of my code
- I made corresponding changes to the documentation
- I confirm My changes generate no new warnings
- I have added tests that prove my fix is effective or that my feature
works
- I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)
  • Loading branch information
frascuchon authored Jul 3, 2024
1 parent 120160d commit 92a3dd6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
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."
)

0 comments on commit 92a3dd6

Please sign in to comment.