|
7 | 7 | pull_request: |
8 | 8 | types: [opened, synchronize, reopened] |
9 | 9 |
|
10 | | -env: |
11 | | - POETRY_VERSION: "2.0.0" |
12 | | - |
13 | 10 | jobs: |
14 | 11 | fix: |
15 | 12 | name: Check Ruff Fix |
|
20 | 17 | steps: |
21 | 18 | - uses: actions/checkout@v4 |
22 | 19 | - uses: actions/setup-python@v5 |
| 20 | + with: |
| 21 | + python-version: "3.11" |
| 22 | + - name: Install uv with caching |
| 23 | + uses: astral-sh/setup-uv@v5 |
| 24 | + with: |
| 25 | + enable-cache: true |
| 26 | + cache-dependency-glob: | |
| 27 | + **/pyproject.toml |
| 28 | + **/uv.lock |
| 29 | + - name: Create and activate virtual environment |
| 30 | + run: | |
| 31 | + uv venv .venv |
| 32 | + echo "${{ github.workspace }}/.venv/bin" >> $GITHUB_PATH |
| 33 | + - name: Install dependencies |
| 34 | + run: uv sync --dev -p .venv |
23 | 35 | - name: Ruff Fix Attempt |
24 | 36 | id: ruff_fix |
25 | 37 | uses: chartboost/ruff-action@v1 |
@@ -47,75 +59,58 @@ jobs: |
47 | 59 | - name: Install Deno |
48 | 60 | run: | |
49 | 61 | curl -fsSL https://deno.land/install.sh | sh |
50 | | - echo "Deno installed" |
51 | | -
|
52 | | - - name: Add Deno to PATH |
53 | | - run: echo "${HOME}/.deno/bin" >> $GITHUB_PATH |
54 | | - |
| 62 | + echo "${HOME}/.deno/bin" >> $GITHUB_PATH |
55 | 63 | - name: Verify Deno installation |
56 | 64 | run: deno --version |
57 | | - |
58 | | - - name: Load cached Poetry installation |
59 | | - id: cached-poetry |
60 | | - uses: actions/cache@v3 |
| 65 | + - name: Install uv with caching |
| 66 | + uses: astral-sh/setup-uv@v5 |
61 | 67 | with: |
62 | | - path: ~/.local |
63 | | - key: poetry-${{ env.POETRY_VERSION }}-${{ hashFiles('**/poetry.lock') }} |
64 | | - - name: Install Poetry |
65 | | - run: python -m pip install --upgrade "poetry==${{ env.POETRY_VERSION }}" |
| 68 | + enable-cache: true |
| 69 | + cache-dependency-glob: | |
| 70 | + **/pyproject.toml |
| 71 | + **/uv.lock |
| 72 | + - name: Create and activate virtual environment |
| 73 | + run: | |
| 74 | + uv venv .venv |
| 75 | + echo "${{ github.workspace }}/.venv/bin" >> $GITHUB_PATH |
66 | 76 | - name: Install dependencies |
67 | 77 | run: | |
68 | | - poetry install --no-interaction |
| 78 | + uv sync --dev -p .venv --extra dev |
| 79 | + uv pip list |
69 | 80 | - name: Run lint with tests |
70 | 81 | uses: chartboost/ruff-action@v1 |
71 | 82 | with: |
72 | 83 | args: check --fix-only |
73 | 84 | - name: Run tests with pytest |
74 | | - run: poetry run pytest tests/ |
75 | | - build_poetry: |
76 | | - name: Build Poetry |
| 85 | + run: uv run -p .venv pytest tests/ |
| 86 | + |
| 87 | + build_package: |
| 88 | + name: Build Package |
77 | 89 | runs-on: ubuntu-latest |
78 | 90 | strategy: |
79 | 91 | matrix: |
80 | 92 | python-version: ["3.11"] |
81 | 93 | steps: |
82 | 94 | - uses: actions/checkout@v4 |
83 | | - - name: Load cached Poetry installation |
84 | | - id: cached-poetry |
85 | | - uses: actions/cache@v3 |
86 | | - with: |
87 | | - path: ~/.local |
88 | | - key: poetry-${{ env.POETRY_VERSION }}-${{ hashFiles('**/poetry.lock') }} |
89 | 95 | - uses: actions/setup-python@v5 |
90 | 96 | with: |
91 | 97 | python-version: ${{ matrix.python-version }} |
92 | | - - name: Install Poetry |
93 | | - run: python -m pip install --upgrade "poetry==${{ env.POETRY_VERSION }}" |
| 98 | + - name: Install uv with caching |
| 99 | + uses: astral-sh/setup-uv@v5 |
| 100 | + with: |
| 101 | + enable-cache: true |
| 102 | + cache-dependency-glob: | |
| 103 | + **/pyproject.toml |
| 104 | + **/uv.lock |
| 105 | + - name: Create and activate virtual environment |
| 106 | + run: | |
| 107 | + uv venv .venv |
| 108 | + echo "${{ github.workspace }}/.venv/bin" >> $GITHUB_PATH |
| 109 | + - name: Install dependencies |
| 110 | + run: uv sync --dev -p .venv --extra dev |
94 | 111 | - name: Build |
95 | | - run: poetry build |
| 112 | + run: uv run -p .venv python -m build |
96 | 113 | - name: Install built package |
97 | | - run: python -m pip install dist/*.whl |
| 114 | + run: uv pip install dist/*.whl -p .venv |
98 | 115 | - name: Test import dspy |
99 | | - run: python -c "import dspy" |
100 | | - |
101 | | - build_setup: |
102 | | - name: Build Setup |
103 | | - runs-on: ubuntu-latest |
104 | | - strategy: |
105 | | - matrix: |
106 | | - python-version: ["3.11"] |
107 | | - steps: |
108 | | - - uses: actions/checkout@v4 |
109 | | - - name: Load cached Poetry installation |
110 | | - id: cached-poetry |
111 | | - uses: actions/cache@v3 |
112 | | - with: |
113 | | - path: ~/.local |
114 | | - key: poetry-${{ env.POETRY_VERSION }}-${{ hashFiles('**/poetry.lock') }} |
115 | | - - uses: actions/setup-python@v5 |
116 | | - with: |
117 | | - python-version: ${{ matrix.python-version }} |
118 | | - - name: Install Poetry |
119 | | - run: python -m pip install --upgrade "poetry==${{ env.POETRY_VERSION }}" |
120 | | - - name: Build the wheel |
121 | | - run: python -m build |
| 116 | + run: uv run -p .venv python -c "import dspy" |
0 commit comments