Skip to content

Commit

Permalink
Update docs workflows to use uv (#1032)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
gabrielmbmb and pre-commit-ci[bot] authored Oct 10, 2024
1 parent 0666dd4 commit dc06161
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 30 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ concurrency:

jobs:
benchmarks:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.12"
# Looks like it's not working very well for other people:
# https://github.com/actions/setup-python/issues/436
# cache: "pip"
# cache-dependency-path: pyproject.toml

- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
Expand All @@ -37,7 +37,7 @@ jobs:
run: ./scripts/install_dependencies.sh

- name: Run benchmarks
uses: CodSpeedHQ/action@v2
uses: CodSpeedHQ/action@v3
with:
token: ${{ secrets.CODSPEED_TOKEN }}
run: pytest tests/ --codspeed
6 changes: 3 additions & 3 deletions .github/workflows/docs-pr-close.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: "3.11"

- name: Install dependencies
run: pip install -e .[docs]
run: ./scripts/install_docs_dependencies.sh

- name: Set git credentials
run: |
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/docs-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,19 @@ jobs:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# Looks like it's not working very well for other people:
# https://github.com/actions/setup-python/issues/436
# cache: "pip"
# cache-dependency-path: pyproject.toml
python-version: "3.11"

- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-docs-pr-v00

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -e .[docs]
run: ./scripts/install_docs_dependencies.sh

- name: Set git credentials
run: |
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,19 @@ jobs:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# Looks like it's not working very well for other people:
# https://github.com/actions/setup-python/issues/436
# cache: "pip"
# cache-dependency-path: pyproject.toml
python-version: "3.11"

- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-docs-v00

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -e .[docs]
run: ./scripts/install_docs_dependencies.sh

- name: Check no warnings
run: mkdocs build --strict
Expand Down
3 changes: 2 additions & 1 deletion examples/arena_hard.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
import re
from typing import Any, Dict, List, Optional, Union

from typing_extensions import override

from distilabel.steps import GlobalStep, StepInput
from distilabel.steps.tasks.base import Task
from distilabel.steps.tasks.typing import ChatType
from distilabel.steps.typing import StepOutput
from typing_extensions import override


class ArenaHard(Task):
Expand Down
7 changes: 4 additions & 3 deletions examples/deepseek_prover.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
from textwrap import dedent
from typing import Any, Dict, List, Optional, Union

from jinja2 import Template
from pydantic import PrivateAttr
from typing_extensions import override

from distilabel.llms import InferenceEndpointsLLM
from distilabel.pipeline import Pipeline
from distilabel.steps import LoadDataFromHub
from distilabel.steps.tasks.base import Task
from distilabel.steps.tasks.typing import ChatType
from jinja2 import Template
from pydantic import PrivateAttr
from typing_extensions import override

_PARSE_DEEPSEEK_PROVER_AUTOFORMAL_REGEX = r"```lean4(.*?)```"

Expand Down
3 changes: 2 additions & 1 deletion examples/structured_generation_with_instructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@

from typing import List

from pydantic import BaseModel, Field

from distilabel.llms import MistralLLM
from distilabel.pipeline import Pipeline
from distilabel.steps import LoadDataFromDicts
from distilabel.steps.tasks import TextGeneration
from pydantic import BaseModel, Field


class Node(BaseModel):
Expand Down
5 changes: 3 additions & 2 deletions examples/structured_generation_with_outlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
from enum import Enum
from pathlib import Path

from pydantic import BaseModel, StringConstraints, conint
from typing_extensions import Annotated

from distilabel.llms import LlamaCppLLM
from distilabel.pipeline import Pipeline
from distilabel.steps import LoadDataFromDicts
from distilabel.steps.tasks import TextGeneration
from pydantic import BaseModel, StringConstraints, conint
from typing_extensions import Annotated


class Weapon(str, Enum):
Expand Down
9 changes: 9 additions & 0 deletions scripts/install_docs_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -e

python_version=$(python -c "import sys; print(sys.version_info[:2])")

python -m pip install uv

uv pip install --system -e ".[docs]"

0 comments on commit dc06161

Please sign in to comment.