Skip to content

Commit 2181789

Browse files
committed
add packaging-tests action
1 parent c87212f commit 2181789

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

.github/workflows/testing.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
# This output will be 'true' if files in the 'table_related_paths' list changed, 'false' otherwise.
1818
table_paths_changed: ${{ steps.filter.outputs.table_related_paths }}
1919
background_cb_changed: ${{ steps.filter.outputs.background_paths }}
20+
packaging_paths_changed: ${{ steps.filter.outputs.packaging_paths }}
2021
steps:
2122
- name: Checkout repository
2223
uses: actions/checkout@v4
@@ -35,6 +36,14 @@ jobs:
3536
- 'dash/_callback.py'
3637
- 'dash/_callback_context.py'
3738
- 'requirements/**'
39+
packaging_paths:
40+
- 'setup.py'
41+
- 'pyproject.toml'
42+
- 'dash/version.py'
43+
- 'MANIFEST.in'
44+
- 'requirements/build.txt'
45+
- 'requirements/install.txt'
46+
- 'tests/test_build/**'
3847
3948
build:
4049
name: Build Dash Package
@@ -441,3 +450,66 @@ jobs:
441450
run: |
442451
cd components/dash-table
443452
pytest --nopercyfinalize --headless --splits 3 --group ${{ matrix.test-group }}
453+
454+
packaging-tests:
455+
name: Package Build Tests
456+
runs-on: ubuntu-latest
457+
needs: [changes_filter]
458+
if: |
459+
(github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev')) ||
460+
needs.changes_filter.outputs.packaging_paths_changed == 'true'
461+
timeout-minutes: 15
462+
463+
steps:
464+
- name: Checkout repository
465+
uses: actions/checkout@v4
466+
with:
467+
fetch-depth: 0
468+
469+
- name: Setup Python
470+
uses: actions/setup-python@v5
471+
with:
472+
python-version: '3.11'
473+
474+
- name: Setup Node.js
475+
uses: actions/setup-node@v4
476+
with:
477+
node-version: '20'
478+
cache: 'npm'
479+
480+
- name: Install uv
481+
uses: astral-sh/setup-uv@v4
482+
with:
483+
enable-cache: true
484+
485+
- name: Install build dependencies
486+
run: |
487+
uv sync --extra build --extra dev
488+
uv pip install pytest
489+
490+
- name: Install JavaScript dependencies
491+
run: npm ci
492+
493+
- name: Build components (required for packaging tests)
494+
run: npm run build
495+
496+
- name: Run packaging tests
497+
run: |
498+
pytest tests/test_build/ -v --tb=short
499+
500+
- name: Test wheel installation with extras
501+
run: |
502+
# Build the wheel
503+
uv build --wheel --out-dir dist-test
504+
505+
# Test basic installation
506+
uv pip install dist-test/*.whl
507+
508+
# Test dev extra installation
509+
uv pip install --force-reinstall "dist-test/*.whl[dev]"
510+
511+
# Test import and basic functionality
512+
python -c "import dash; print(f'Dash {dash.__version__} imported successfully')"
513+
514+
# Test dev tools are available
515+
python -c "import fire, coloredlogs, yaml; print('Dev dependencies available')"

0 commit comments

Comments
 (0)