Skip to content

Commit

Permalink
[FEAT] Move argilla to argilla-v1 and define the new SDK as `argi…
Browse files Browse the repository at this point in the history
…lla` (#4975)

<!-- Thanks for your contribution! As part of our Community Growers
initiative 🌱, we're donating Justdiggit bunds in your name to reforest
sub-Saharan Africa. To claim your Community Growers certificate, please
contact David Berenstein in our Slack community or fill in this form
https://tally.so/r/n9XrxK once your PR has been merged. -->

# Description

This is a WIP PR to evaluate using the new argilla SDK as the `argilla`
module in Python. The changes included in this PR do not affect the
current `argilla-sdk` project. I've created a brand new `argilla`
project quite simple. The project `argilla` manages dependencies for
both SDK versions under the same package.

Having this new `argilla` package is not a requirement. We can rename
the current `argilla-sdk` to `argilla` and include the `argilla-v1`
dependency and the `v1` module. We've already discussed having a bundle
package for adding and managing extensions or contribs packages through
argilla:
```bash
pip install argilla[extensions]
pip install argilla[contrib]
```
instead of
```bash
pip install argilla-extensions
pip install argilla-contrib
````

But I think this can be tackled once we have more packages other than
argilla. So, my proposal for the v2 release is to move `argilla-sdk` to
the official `argilla` project.


## Update 

The decision will be to rename `argilla-sdk` to `argilla` and expose the
`v1` as a dependency.. See PR
#4975 to see some of this
work.


Refs: #4889

**Type of change**

(Please delete options that are not relevant. Remember to title the PR
according to the type of change)

- [ ] New feature (non-breaking change which adds functionality)
- [ ] Refactor (change restructuring the codebase without changing
functionality)
- [ ] Improvement (change adding some improvement to an existing
functionality)

**How Has This Been Tested**

(Please describe the tests that you ran to verify your changes. And
ideally, reference `tests`)

- [ ] Test A
- [ ] Test B

**Checklist**

- [ ] I added relevant documentation
- [ ] I followed the style guidelines of this project
- [ ] I did a self-review of my code
- [ ] I made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [ ] I have added relevant notes to the `CHANGELOG.md` file (See
https://keepachangelog.com/)
  • Loading branch information
frascuchon authored Jun 13, 2024
1 parent 450bfa3 commit b82e4d2
Show file tree
Hide file tree
Showing 641 changed files with 2,305 additions and 3,573 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/argilla-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:

pull_request:
paths:
- "argilla/**"
- "argilla-v1/**"

release:
types:
Expand All @@ -32,7 +32,7 @@ jobs:
defaults:
run:
shell: bash -l {0}
working-directory: argilla
working-directory: argilla-v1

steps:
- name: Checkout Code 🛎
Expand All @@ -56,7 +56,7 @@ jobs:
id: cache
with:
path: ${{ env.CONDA }}/envs
key: conda-${{ runner.os }}--${{ runner.arch }}--${{ steps.get-date.outputs.today }}-${{ hashFiles('argilla/environment_dev.yml') }}-${{ env.CACHE_NUMBER }}
key: conda-${{ runner.os }}--${{ runner.arch }}--${{ steps.get-date.outputs.today }}-${{ hashFiles('argilla-v1/environment_dev.yml') }}-${{ env.CACHE_NUMBER }}

- name: Update environment
if: steps.cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -97,8 +97,8 @@ jobs:
- name: Upload package artifact
uses: actions/upload-artifact@v4
with:
name: argilla
path: argilla/dist
name: argilla-v1
path: argilla-v1/dist

# This job will upload a Python Package using Twine when a release is created
# For more information see:
Expand All @@ -114,15 +114,15 @@ jobs:
defaults:
run:
shell: bash -l {0}
working-directory: argilla
working-directory: argilla-v1

steps:
- name: Checkout Code 🛎
uses: actions/checkout@v4
- name: Download python package
uses: actions/download-artifact@v4
with:
name: argilla
name: argilla-v1
path: dist
- name: Publish Package to TestPyPI 🥪
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ concurrency:
on:
push:
paths:
- "argilla-sdk/docs/**"
- "argilla-sdk/src/**"
- "argilla/docs/**"
- "argilla/src/**"
branches:
# - "main"
# - "develop"
Expand All @@ -19,17 +19,16 @@ on:

defaults:
run:
working-directory: argilla-sdk
working-directory: argilla

jobs:
publish:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.10" ]
python-version: ["3.10"]
steps:

- name: checkout docs-site
uses: actions/checkout@v4
with:
Expand All @@ -43,7 +42,7 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: true
cache-dependency-path: |
argilla-sdk/pyproject.toml
argilla/pyproject.toml
- name: Install dependencies
run: |
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/argilla-sdk.yml → .github/workflows/argilla.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Build and publish the `argilla-sdk` python package
name: Build and publish the `argilla` sdk python package

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -15,17 +15,17 @@ on:

push:
paths:
- "argilla-sdk/**"
- "!argilla-sdk/docs/**"
- "argilla/**"
- "!argilla/docs/**"
branches:
- "develop"
- "main"
- "feat/**"

pull_request:
paths:
- "argilla-sdk/**"
- "!argilla-sdk/docs/**"
- "argilla/**"
- "!argilla/docs/**"
branches:
- "develop"
- "main"
Expand All @@ -37,7 +37,7 @@ on:

defaults:
run:
working-directory: argilla-sdk
working-directory: argilla

jobs:
build:
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: true
cache-dependency-path: |
argilla-sdk/pyproject.toml
argilla/pyproject.toml
- name: Install dependencies
run: |
pdm install
Expand All @@ -86,10 +86,10 @@ jobs:
# Upload the package to be used in the next jobs only once
if: ${{ matrix.python-version == '3.8' }}
with:
name: argilla-sdk
path: argilla-sdk/dist
name: argilla
path: argilla/dist

# This job will publish argilla-sdk package into PyPI repository
# This job will publish argilla package into PyPI repository
publish_release:
name: Publish Release
runs-on: ubuntu-latest
Expand All @@ -116,8 +116,8 @@ jobs:
- name: Download python package
uses: actions/download-artifact@v4
with:
name: argilla-sdk
path: argilla-sdk/dist
name: argilla
path: argilla/dist

- name: Setup PDM
uses: pdm-project/setup-pdm@v4
Expand Down
43 changes: 1 addition & 42 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,6 @@ repos:
##############################################################################
# argilla specific hooks
##############################################################################
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
files: '^argilla/.*\.py$'
- id: end-of-file-fixer
files: '^argilla/.*\.py$'
exclude_types: [ text, jupyter ]
- id: trailing-whitespace
files: '^argilla/.*\.py$'
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
hooks:
- id: insert-license
name: "Insert license header in Python source files"
files: '^argilla/.*\.py$'
args:
- --license-filepath
- license_header.txt
- --fuzzy-match-generates-todo
# - --remove-header
- repo: https://github.com/psf/black
rev: 23.10.1
hooks:
- id: black
additional_dependencies: [ "typer==0.7.0" ]
# only run for argilla/ files
files: '^argilla/.*\.py$'
args: [ --line-length=120 ]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
hooks:
# Simulate isort via (the much faster) ruff
- id: ruff
files: '^argilla/.*\.py$'
args:
- --select=I
- --fix
##############################################################################
# argilla-sdk specific hooks
##############################################################################
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
hooks:
Expand Down Expand Up @@ -87,5 +46,5 @@ ci:
autoupdate_branch: ""
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
autoupdate_schedule: weekly
skip: [ ]
skip: []
submodules: false
55 changes: 0 additions & 55 deletions argilla-sdk/README.md

This file was deleted.

Loading

0 comments on commit b82e4d2

Please sign in to comment.