-
Notifications
You must be signed in to change notification settings - Fork 389
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Prepare new argilla package (#5006)
<!-- 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 PR applies several changes to achieve the new argilla project structure: - The `argilla-sdk` becomes the new `argilla` project. - The old `argilla` project has been moved to `argilla-v1` (and its package) - The github actions have been renamed conforming the new repo structure. Closes #4889 Closes #4888 Closes #4828 **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) - [X] Refactor (change restructuring the codebase without changing functionality) - [X] 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
1 parent
8e9f42b
commit da23ea9
Showing
657 changed files
with
4,551 additions
and
4,574 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
name: Build Argilla (v1) package | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
push: | ||
paths: | ||
- argilla-v1/** | ||
tags: | ||
- "*" | ||
branches: | ||
- main | ||
- develop | ||
- feat/** | ||
- releases/** | ||
|
||
pull_request: | ||
paths: | ||
- argilla-v1/** | ||
|
||
release: | ||
types: | ||
- "published" | ||
- "released" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
working-directory: argilla-v1 | ||
|
||
steps: | ||
- name: Checkout Code 🛎 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Conda Env 🐍 | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
miniforge-variant: Mambaforge | ||
miniforge-version: latest | ||
use-mamba: true | ||
activate-environment: argilla | ||
|
||
- name: Get date for conda cache | ||
id: get-date | ||
run: echo "::set-output name=today::$(/bin/date -u '+%Y%m%d')" | ||
shell: bash | ||
|
||
- name: Cache Conda env | ||
uses: actions/cache@v3 | ||
id: cache | ||
with: | ||
path: ${{ env.CONDA }}/envs | ||
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' | ||
run: mamba env update -n argilla -f environment_dev.yml | ||
|
||
- name: Cache pip 👜 | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ env.CACHE_NUMBER }}-${{ hashFiles('pyproject.toml') }} | ||
|
||
- name: Set huggingface hub credentials | ||
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/releases') | ||
run: | | ||
echo "HF_HUB_ACCESS_TOKEN=${{ secrets.HF_HUB_ACCESS_TOKEN }}" >> "$GITHUB_ENV" | ||
echo "Enable HF access token" | ||
- name: Run unit tests 📈 | ||
run: | | ||
pip install -e ".[server,listeners]" | ||
pytest tests/unit -vs | ||
- name: Run tests with pandas v2 📈 | ||
run: | | ||
pip install "pandas~=2.0" pytest-custom_exit_code | ||
pytest --suppress-no-test-exit-code tests/unit -vs | ||
- name: Run tests with pydantic v2 📈 | ||
run: | | ||
pip install "pydantic~=2.0" pytest-custom_exit_code | ||
pytest --suppress-no-test-exit-code tests/unit -vs | ||
- name: Build Package 🍟 | ||
run: | | ||
pip install -U build | ||
rm -rf dist && python -m build | ||
- name: Upload package artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
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: | ||
# https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | ||
publish_release: | ||
name: Publish Release | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event_name == 'release' }} | ||
|
||
needs: | ||
- build | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
working-directory: argilla-v1 | ||
|
||
steps: | ||
- name: Checkout Code 🛎 | ||
uses: actions/checkout@v4 | ||
- name: Download python package | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: argilla-v1 | ||
path: dist | ||
- name: Publish Package to TestPyPI 🥪 | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
continue-on-error: true | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.AR_TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
- name: Test Installing 🍿 | ||
continue-on-error: true | ||
run: pip install --index-url https://test.pypi.org/simple --no-deps argilla==${GITHUB_REF#refs/*/v} | ||
|
||
- name: Publish Package to PyPI 🥩 | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.AR_PYPI_API_TOKEN }} |
Oops, something went wrong.