Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

frontend build location (#1026) #2342

frontend build location (#1026)

frontend build location (#1026) #2342

Workflow file for this run

name: Setuptools
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
workflow_dispatch:
jobs:
standard-packages:
timeout-minutes: 60
strategy:
matrix:
python-versions: ['3.8', '3.9', '3.10', '3.11']
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-versions }}
- name: Install npm
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Taipy without dependencies
run: |
# Install package
echo "Install package"
pip install .
rm -r src
# Ensure `webapp` folder is present in lib package
echo "Ensure webapp folder is present in lib package"
python -c "import taipy.gui as gui;from pathlib import Path; assert Path(f'{gui.__path__[0]}/webapp/index.html').exists(), f'{gui.__path__[0]}/webapp/index.html not found!'"
# Run tests
echo "installing playwright"
pip install pytest pytest-mock playwright pytest-playwright pytest-timeout testbook
pip install ipython ipykernel
ipython kernel install --name "python3" --user
playwright install chromium --with-deps
echo "running pytest"
pytest -s
echo "running test import tp"
python -c "import taipy as tp; tp.Gui"
optional-packages:
timeout-minutes: 60
strategy:
matrix:
python-versions: ['3.8', '3.9', '3.10', '3.11']
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-versions }}
- name: Install npm
uses: actions/setup-node@v4
with:
node-version: '20'
- name: install libmagic on macos
if: matrix.os == 'macos-latest'
run: brew install libmagic
- name: Add optionals dependencies
run: |
# Extract optionals packages before installing them
grep -n 'setup(' setup.py | cut -d ":" -f 1 | xargs -I% bash -c "expr % - 1" | xargs -I% bash -c 'head -n% setup.py' > setup_packages.py
echo "[print(k) for k in extras_require.keys()]" >> setup_packages.py
python setup_packages.py | xargs -I% bash -c "pip install .[%]"
# Ensure `webapp` folder is present in lib package
python -c "import taipy.gui as gui;from pathlib import Path; assert Path(f'{gui.__path__[0]}/webapp/index.html').exists(), f'{gui.__path__[0]}/webapp/index.html not found!'"
# Removal of Taipy code to ensure the use of the installed package.
rm -r src
# Run test with optionals packages installed
echo "installing playwright"
pip install pytest pytest-mock playwright pytest-playwright pytest-timeout testbook
pip install ipython ipykernel
ipython kernel install --name "python3" --user
playwright install chromium --with-deps
echo "running pytest"
pytest -s | tee pytest_res
cat pytest_res
echo "Ensure that no tests are skipped"
tail -n1 pytest_res | grep --invert-match "skipped"
echo "Ensure that no warnings are issued"
tail -n1 pytest_res | grep --invert-match "warning"
echo "Ensure that no tests are failed"
tail -n1 pytest_res | grep --invert-match "failed"