Skip to content

Commit 68c1560

Browse files
committed
fix uv venv in testing
1 parent dc35469 commit 68c1560

File tree

1 file changed

+50
-6
lines changed

1 file changed

+50
-6
lines changed

.github/workflows/testing.yml

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,14 @@ jobs:
135135
with:
136136
enable-cache: true
137137

138+
- name: Create virtual environment and install dependencies
139+
run: |
140+
uv venv .venv --python 3.12
141+
source .venv/bin/activate
142+
uv sync --extra ci --extra testing --extra dev
143+
echo "VIRTUAL_ENV=$PWD/.venv" >> $GITHUB_ENV
144+
echo "$PWD/.venv/bin" >> $GITHUB_PATH
145+
138146
- name: Download built Dash packages
139147
uses: actions/download-artifact@v4
140148
with:
@@ -143,7 +151,9 @@ jobs:
143151

144152
- name: Install Dash packages
145153
run: |
146-
find packages -name dash-*.whl -print -exec uv pip install "{}[ci,testing,dev]" \;
154+
WHEEL_FILE=$(find packages -name "dash-*.whl" | head -1)
155+
echo "Installing wheel: $WHEEL_FILE"
156+
uv pip install "$WHEEL_FILE[ci,testing,dev]"
147157
148158
- name: Build/Setup test components
149159
run: npm run setup-tests.py # TODO build the packages and save them to packages/ in build job
@@ -206,6 +216,14 @@ jobs:
206216
with:
207217
enable-cache: true
208218

219+
- name: Create virtual environment and install dependencies
220+
run: |
221+
uv venv .venv --python ${{ matrix.python-version }}
222+
source .venv/bin/activate
223+
uv sync --extra async --extra ci --extra testing --extra dev --extra celery --extra diskcache
224+
echo "VIRTUAL_ENV=$PWD/.venv" >> $GITHUB_ENV
225+
echo "$PWD/.venv/bin" >> $GITHUB_PATH
226+
209227
- name: Download built Dash packages
210228
uses: actions/download-artifact@v4
211229
with:
@@ -215,7 +233,9 @@ jobs:
215233
- name: Install Dash packages
216234
run: |
217235
uv pip install "selenium==4.32.0"
218-
find packages -name dash-*.whl -print -exec uv pip install "{}[async,ci,testing,dev,celery,diskcache]" \;
236+
WHEEL_FILE=$(find packages -name "dash-*.whl" | head -1)
237+
echo "Installing wheel: $WHEEL_FILE"
238+
uv pip install "$WHEEL_FILE[async,ci,testing,dev,celery,diskcache]"
219239
220240
- name: Install Google Chrome
221241
run: |
@@ -322,6 +342,14 @@ jobs:
322342
with:
323343
enable-cache: true
324344

345+
- name: Create virtual environment and install dependencies
346+
run: |
347+
uv venv .venv --python ${{ matrix.python-version }}
348+
source .venv/bin/activate
349+
uv sync --extra ci --extra testing --extra dev
350+
echo "VIRTUAL_ENV=$PWD/.venv" >> $GITHUB_ENV
351+
echo "$PWD/.venv/bin" >> $GITHUB_PATH
352+
325353
- name: Download built Dash packages
326354
uses: actions/download-artifact@v4
327355
with:
@@ -330,7 +358,9 @@ jobs:
330358

331359
- name: Install Dash packages
332360
run: |
333-
find packages -name dash-*.whl -print -exec uv pip install "{}[ci,testing,dev]" \;
361+
WHEEL_FILE=$(find packages -name "dash-*.whl" | head -1)
362+
echo "Installing wheel: $WHEEL_FILE"
363+
uv pip install "$WHEEL_FILE[ci,testing,dev]"
334364
335365
- name: Lint
336366
run: |
@@ -383,6 +413,14 @@ jobs:
383413
with:
384414
enable-cache: true
385415

416+
- name: Create virtual environment and install dependencies
417+
run: |
418+
uv venv .venv --python ${{ matrix.python-version }}
419+
source .venv/bin/activate
420+
uv sync --extra ci --extra testing --extra dev
421+
echo "VIRTUAL_ENV=$PWD/.venv" >> $GITHUB_ENV
422+
echo "$PWD/.venv/bin" >> $GITHUB_PATH
423+
386424
- name: Download built Dash packages
387425
uses: actions/download-artifact@v4
388426
with:
@@ -391,7 +429,9 @@ jobs:
391429

392430
- name: Install Dash packages
393431
run: |
394-
find packages -name dash-*.whl -print -exec uv pip install "{}[ci,testing,dev]" \;
432+
WHEEL_FILE=$(find packages -name "dash-*.whl" | head -1)
433+
echo "Installing wheel: $WHEEL_FILE"
434+
uv pip install "$WHEEL_FILE[ci,testing,dev]"
395435
uv pip install pytest-split
396436
397437
- name: Install Google Chrome
@@ -509,11 +549,15 @@ jobs:
509549
# Build the wheel
510550
uv build --wheel --out-dir dist-test
511551
552+
# Find the wheel file
553+
WHEEL_FILE=$(find dist-test -name "*.whl" | head -1)
554+
echo "Found wheel: $WHEEL_FILE"
555+
512556
# Test basic installation
513-
uv pip install dist-test/*.whl
557+
uv pip install "$WHEEL_FILE"
514558
515559
# Test dev extra installation
516-
uv pip install --force-reinstall "dist-test/*.whl[dev]"
560+
uv pip install --force-reinstall "$WHEEL_FILE[dev]"
517561
518562
# Test import and basic functionality
519563
python -c "import dash; print(f'Dash {dash.__version__} imported successfully')"

0 commit comments

Comments
 (0)