From d5441d5374fd2e09631ea27524f89ddcf7e36b85 Mon Sep 17 00:00:00 2001 From: Elron Bandel Date: Sun, 30 Jun 2024 18:58:26 +0300 Subject: [PATCH] Use uv for installing requirements in actions (#960) * Use uv for installing requirements in actions Signed-off-by: elronbandel * try Signed-off-by: elronbandel * another try Signed-off-by: elronbandel * another try Signed-off-by: elronbandel * Update all Signed-off-by: elronbandel * another try Signed-off-by: elronbandel * another try Signed-off-by: elronbandel * Another try Signed-off-by: elronbandel * Fix coverage Signed-off-by: elronbandel * Fix Signed-off-by: elronbandel --------- Signed-off-by: elronbandel --- .github/workflows/catalog_consistency.yml | 9 ++---- .github/workflows/catalog_preparation.yml | 7 ++--- .github/workflows/docs.yml | 28 ++++++++----------- .../library_eager_execution_tests.yml | 14 ++++------ .github/workflows/library_tests.yml | 7 ++--- 5 files changed, 25 insertions(+), 40 deletions(-) diff --git a/.github/workflows/catalog_consistency.yml b/.github/workflows/catalog_consistency.yml index 9169aac77..a3beb645e 100644 --- a/.github/workflows/catalog_consistency.yml +++ b/.github/workflows/catalog_consistency.yml @@ -20,12 +20,9 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.9' - cache: 'pip' # caching pip dependencies - - run: pip install -r requirements/base.rqr - - run: pip install -r requirements/tests.rqr - - - name: Install Unitxt From Source - run: pip install -e . + + - run: curl -LsSf https://astral.sh/uv/install.sh | sh + - run: uv pip install --system -e ".[tests]" - name: Run Tests run: python utils/prepare_all_artifacts.py \ No newline at end of file diff --git a/.github/workflows/catalog_preparation.yml b/.github/workflows/catalog_preparation.yml index 67c4afa30..e45573baf 100644 --- a/.github/workflows/catalog_preparation.yml +++ b/.github/workflows/catalog_preparation.yml @@ -20,10 +20,9 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.9' - cache: 'pip' # caching pip dependencies - - run: pip install -r requirements/base.rqr - - run: pip install -r requirements/tests.rqr - - run: pip install -e . + + - run: curl -LsSf https://astral.sh/uv/install.sh | sh + - run: uv pip install --system ".[tests]" - name: Run Tests run: python -m unittest discover -s tests/catalog -p "test_*.py" \ No newline at end of file diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c0f4f454c..764a4d399 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -15,22 +15,16 @@ jobs: PYTHONPATH: ./docs steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.8' - cache: 'pip' # caching pip dependencies - - run: pip install -r requirements/base.rqr - - run: pip install -r requirements/docs.rqr - - - name: Install package - run: | - pip install -e . - - - name: Print Python Path - run: python -c "import sys; print(sys.path)" - - - name: Compile Docs - run: make docs + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: '3.9' + + - run: curl -LsSf https://astral.sh/uv/install.sh | sh + - run: uv pip install --system ".[tests,docs]" + + - name: Compile Docs + run: make docs diff --git a/.github/workflows/library_eager_execution_tests.yml b/.github/workflows/library_eager_execution_tests.yml index 5a27a4d83..1a43133c9 100644 --- a/.github/workflows/library_eager_execution_tests.yml +++ b/.github/workflows/library_eager_execution_tests.yml @@ -20,14 +20,10 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.9' - cache: 'pip' # caching pip dependencies - - run: pip install -r requirements/base.rqr - - run: pip install -r requirements/tests.rqr - - run: pip install -e . - - run: pip install coverage[toml] + # cache: 'pip' # caching pip dependencies + - run: curl -LsSf https://astral.sh/uv/install.sh | sh + - run: uv pip install --system ".[tests]" + - run: uv pip install --system coverage[toml] - name: Run Tests - run: coverage run --omit=*/preparation -m unittest discover -s tests/library -p "test_*.py" - - - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v2 \ No newline at end of file + run: coverage run --omit=*/preparation -m unittest discover -s tests/library -p "test_*.py" \ No newline at end of file diff --git a/.github/workflows/library_tests.yml b/.github/workflows/library_tests.yml index df6d43077..3f44a5941 100644 --- a/.github/workflows/library_tests.yml +++ b/.github/workflows/library_tests.yml @@ -19,10 +19,9 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.9' - cache: 'pip' # caching pip dependencies - - run: pip install -r requirements/base.rqr - - run: pip install -r requirements/tests.rqr - - run: pip install -e . + + - run: curl -LsSf https://astral.sh/uv/install.sh | sh + - run: uv pip install --system -e ".[tests]" - run: pip install coverage[toml] - name: Run Tests