Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/mckinsey/vizro into score_t…
Browse files Browse the repository at this point in the history
…ests_improvements

� Conflicts:
�	vizro-ai/hatch.toml
�	vizro-ai/pyproject.toml
�	vizro-ai/tests/e2e/data_classes.py
�	vizro-ai/tests/e2e/prompts.py
�	vizro-ai/tests/e2e/pytest.ini
�	vizro-ai/tests/e2e/test_dashboard.py
  • Loading branch information
l0uden committed Feb 3, 2025
2 parents c52f366 + 41865a6 commit 7002214
Show file tree
Hide file tree
Showing 144 changed files with 3,797 additions and 2,629 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ runs:
- name: Copy failed screenshots
shell: bash
run: |
mkdir /home/runner/work/vizro/vizro/vizro-core/failed_screenshots/
cd /home/runner/work/vizro/vizro/vizro-core/
mkdir ${{ env.PROJECT_PATH }}failed_screenshots/
cd ${{ env.PROJECT_PATH }}
cp *.png failed_screenshots
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: Failed screenshots
path: |
/home/runner/work/vizro/vizro/vizro-core/failed_screenshots/*.png
${{ env.PROJECT_PATH }}failed_screenshots/*.png
- name: Send custom JSON data to Slack
id: slack
Expand Down
Binary file added .github/images/toolkit_vizro_ai_fallback.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/vizro_spash_teaser_fallback.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .github/workflows/checks-vizro-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ jobs:
- name: Check schema is up to date
run: hatch run schema-check

- name: Check plotly template is up to date
run: hatch run templates-check

- name: Find changed files to see if changelog fragment needed
id: changed-files
if: ${{ github.event_name == 'pull_request' }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ jobs:
env:
TESTS_NAME: Vizro e2e component library tests
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
PROJECT_PATH: /home/runner/work/vizro/vizro/vizro-core/
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Score tests for VizroAI
name: e2e dashboard tests for VizroAI

defaults:
run:
Expand All @@ -18,9 +18,9 @@ env:
FORCE_COLOR: 1

jobs:
test-score-vizro-ai-fork:
test-e2e-dashboard-vizro-ai-fork:
if: ${{ github.event.pull_request.head.repo.fork }}
name: test-score-vizro-ai on Py${{ matrix.config.python-version }} ${{ matrix.config.label }}
name: test-e2e-dashboard-vizro-ai on Py${{ matrix.config.python-version }} ${{ matrix.config.label }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -35,9 +35,9 @@ jobs:
- name: Passed fork step
run: echo "Success!"

test-score-vizro-ai:
test-e2e-dashboard-vizro-ai:
if: ${{ ! github.event.pull_request.head.repo.fork }}
name: test-score-vizro-ai on Py${{ matrix.config.python-version }} ${{ matrix.config.label }}
name: test-e2e-dashboard-vizro-ai on Py${{ matrix.config.python-version }} ${{ matrix.config.label }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -60,8 +60,8 @@ jobs:
- name: Show dependency tree
run: hatch run ${{ matrix.config.hatch-env }}:pip tree

- name: Run vizro-ai score tests with PyPI vizro
run: hatch run ${{ matrix.config.hatch-env }}:test-score
- name: Run vizro-ai e2e dashboard tests with PyPI vizro
run: hatch run ${{ matrix.config.hatch-env }}:test-e2e-dashboard
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }}
Expand All @@ -71,10 +71,10 @@ jobs:
BRANCH: ${{ github.head_ref }}
PYTHON_VERSION: ${{ matrix.config.python-version }}

- name: Run vizro-ai score tests with local vizro
- name: Run vizro-ai e2e dashboard tests with local vizro
run: |
hatch run ${{ matrix.config.hatch-env }}:pip install ../vizro-core
hatch run ${{ matrix.config.hatch-env }}:test-score
hatch run ${{ matrix.config.hatch-env }}:test-e2e-dashboard
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }}
Expand All @@ -91,7 +91,7 @@ jobs:
with:
payload: |
{
"text": "Vizro-ai ${{ matrix.config.hatch-env }} score tests build result: ${{ job.status }}\nBranch: ${{ github.head_ref }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
"text": "Vizro-ai ${{ matrix.config.hatch-env }} e2e dashboard tests build result: ${{ job.status }}\nBranch: ${{ github.head_ref }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand All @@ -103,10 +103,10 @@ jobs:
with:
name: Report-${{ matrix.config.python-version }}-${{ matrix.config.label }}
path: |
/home/runner/work/vizro/vizro/vizro-ai/tests/score/reports/report*.csv
/home/runner/work/vizro/vizro/vizro-ai/tests/e2e/reports/report*.csv
test-score-vizro-ai-report:
needs: test-score-vizro-ai
test-e2e-dashboard-vizro-ai-report:
needs: test-e2e-dashboard-vizro-ai
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Integration tests for VizroAI
name: e2e plot tests for VizroAI

defaults:
run:
Expand All @@ -20,9 +20,9 @@ env:
FORCE_COLOR: 1

jobs:
test-integration-vizro-ai-fork:
test-e2e-plot-vizro-ai-fork:
if: ${{ github.event.pull_request.head.repo.fork }}
name: test-integration-vizro-ai on Py${{ matrix.config.python-version }} ${{ matrix.config.label }}
name: test-e2e-plot-vizro-ai on Py${{ matrix.config.python-version }} ${{ matrix.config.label }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -69,9 +69,9 @@ jobs:
- name: Passed fork step
run: echo "Success!"

test-integration-vizro-ai:
test-e2e-plot-vizro-ai:
if: ${{ ! github.event.pull_request.head.repo.fork }}
name: test-integration-vizro-ai on Py${{ matrix.config.python-version }} ${{ matrix.config.label }}
name: test-e2e-plot-vizro-ai on Py${{ matrix.config.python-version }} ${{ matrix.config.label }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -126,17 +126,17 @@ jobs:
- name: Show dependency tree
run: hatch run ${{ matrix.config.hatch-env }}:pip tree

- name: Run vizro-ai integration tests with PyPI vizro
run: hatch run ${{ matrix.config.hatch-env }}:test-integration
- name: Run vizro-ai e2e plot tests with PyPI vizro
run: hatch run ${{ matrix.config.hatch-env }}:test-e2e-plot
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }}
VIZRO_TYPE: pypi

- name: Run vizro-ai integration tests with local vizro
- name: Run vizro-ai e2e plot tests with local vizro
run: |
hatch run ${{ matrix.config.hatch-env }}:pip install ../vizro-core
hatch run ${{ matrix.config.hatch-env }}:test-integration
hatch run ${{ matrix.config.hatch-env }}:test-e2e-plot
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }}
Expand All @@ -149,7 +149,7 @@ jobs:
with:
payload: |
{
"text": "Vizro-ai ${{ matrix.config.hatch-env }} integration tests build result: ${{ job.status }}\nBranch: ${{ github.head_ref }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
"text": "Vizro-ai ${{ matrix.config.hatch-env }} e2e plot tests build result: ${{ job.status }}\nBranch: ${{ github.head_ref }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/test-vizro-ai-ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: tests for VizroAI UI

defaults:
run:
working-directory: vizro-ai

on:
push:
branches: [main]
pull_request:
branches:
- main
paths:
- "vizro-ai/**"
- "!vizro-ai/docs/**"

env:
PYTHONUNBUFFERED: 1
FORCE_COLOR: 1
PYTHON_VERSION: "3.12"

jobs:
test-vizro-ai-ui-fork:
if: ${{ github.event.pull_request.head.repo.fork }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Passed fork step
run: echo "Success!"

test-vizro-ai-ui:
if: ${{ ! github.event.pull_request.head.repo.fork }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install Hatch
run: pip install hatch

- name: Show dependency tree
run: hatch run pip tree

- name: Run VizroAI UI tests
run: hatch run test-vizro-ai-ui
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }}

- name: Send custom JSON data to Slack
id: slack
uses: slackapi/[email protected]
if: failure()
with:
payload: |
{
"text": "VizroAI UI tests build result: ${{ job.status }}\nBranch: ${{ github.head_ref }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
59 changes: 59 additions & 0 deletions .github/workflows/update-icons.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Update Material Icons

on:
schedule:
- cron: "0 0 1 * *" # Runs at midnight on the 1st of every month

defaults:
run:
working-directory: vizro-core

env:
PYTHON_VERSION: "3.12"

jobs:
check-update:
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Hatch
run: pip install hatch
- name: Update Material font
run: |
hatch run update-icons
- name: Check for changes
run: |
git config user.email "[email protected]"
git config user.name "Vizro Team"
git diff --exit-code || echo "has_changes=true" >> $GITHUB_ENV
update-icons:
runs-on: ubuntu-latest
needs: [check-update]
if: |
env.has_changes == 'true'
steps:
- name: Delete old branch if exists
run: |
git push origin --delete bot/update-material-icons || true
- name: Create and push changes
run: |
git checkout -b bot/update-material-icons
hatch run changelog:add
git add -A
git commit -m "Update Material Icons"
git push --set-upstream origin bot/update-material-icons
- name: Install GitHub CLI
run: sudo apt-get install -y gh
- name: Create Pull Request
run: |
gh pr create -B main -H bot/update-material-icons --title "[Bot] Update Material Icons" --body "Automated update of Material Icons"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 0 additions & 4 deletions .github/workflows/vizro-qa-tests-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
matrix:
include:
- label: integration tests
- label: vizro-ai ui tests
steps:
- name: Passed fork step
run: echo "Success!"
Expand All @@ -34,7 +33,6 @@ jobs:
matrix:
include:
- label: integration tests
- label: vizro-ai ui tests
steps:
- uses: actions/checkout@v4
- name: Tests trigger
Expand All @@ -44,8 +42,6 @@ jobs:
if [ "${{ matrix.label }}" == "integration tests" ]; then
export INPUT_WORKFLOW_FILE_NAME=${{ secrets.VIZRO_QA_INTEGRATION_TESTS_WORKFLOW }}
elif [ "${{ matrix.label }}" == "vizro-ai ui tests" ]; then
export INPUT_WORKFLOW_FILE_NAME=${{ secrets.VIZRO_QA_VIZRO_AI_UI_TESTS_WORKFLOW }}
fi
export INPUT_GITHUB_TOKEN=${{ secrets.VIZRO_SVC_PAT }}
export INPUT_REF=main # because we should send existent branch to dispatch workflow
Expand Down
7 changes: 2 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ repos:
additional_dependencies: ["bandit[toml]"]

- repo: https://github.com/pre-commit/mirrors-mypy
# Upgrade to v1.11.1 not possible as it doesn't seem compatible with pydantic<2 plugin.
# Similar issue with previous v.1.11.X versions: https://github.com/pydantic/pydantic/issues/10000
# We need to revert the changes from the pre-commit autoupdate for now.
rev: v1.10.1
rev: v1.14.1
hooks:
- id: mypy
files: ^vizro-core/src/
Expand All @@ -72,7 +69,7 @@ repos:
# pydantic>=1.10.15 includes this fix which flags some genuine type problems. These will take a while to fix
# or ignore so for now we just pin to 1.10.14 which doesn't flag the problems.
# https://github.com/pydantic/pydantic/pull/8765
- pydantic==1.10.14
- pydantic==2.9.0

- repo: https://github.com/awebdeveloper/pre-commit-stylelint
rev: "0.0.2"
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mckinsey/vizro/main/.github/images/Vizro_Github_Banner_Dark_Mode.png">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/mckinsey/vizro/main/.github/images/Vizro_Github_Banner_Light_Mode.png">
<img alt="Vizro logo" src="https://raw.githubusercontent.com/mckinsey/vizro/main/.github/images/Vizro_Github_Banner_Dark_Mode.png" width="250">
<img alt="Vizro logo" src="https://raw.githubusercontent.com/mckinsey/vizro/main/.github/images/Vizro_Github_Banner_Light_Mode.png" width="250">
</picture>

#### Vizro is a low-code toolkit for building high-quality data visualization apps
Expand All @@ -14,7 +14,10 @@

[Documentation](https://vizro.readthedocs.io/en/stable/) | [Get Started](https://vizro.readthedocs.io/en/stable/pages/tutorials/first_dashboard/) | [Vizro examples gallery](http://vizro.mckinsey.com/)

<img src="https://raw.githubusercontent.com/mckinsey/vizro/main/.github/images/vizro_spash_teaser.gif" width="600"/>
<picture>
<source srcset="https://raw.githubusercontent.com/mckinsey/vizro/main/.github/images/vizro_spash_teaser.gif">
<img alt="Gif to demonstrate Vizro features" src="https://raw.githubusercontent.com/mckinsey/vizro/main/.github/images/vizro_spash_teaser_fallback.png" width="600">
</picture>
<br>
<br>
<img src="https://raw.githubusercontent.com/mckinsey/vizro/main/.github/images/logo_watermarks.svg" width="300">
Expand Down Expand Up @@ -120,7 +123,10 @@ Vizro-AI is a separate package (called `vizro_ai`) that extends Vizro to incorpo

Visit the [Vizro-AI documentation](https://vizro.readthedocs.io/projects/vizro-ai/) for more details.

<img width="600" src="https://raw.githubusercontent.com/mckinsey/vizro/main/.github/images/toolkit_vizro_ai.gif">
<picture>
<source srcset="https://raw.githubusercontent.com/mckinsey/vizro/main/.github/images/toolkit_vizro_ai.gif">
<img alt="Gif to demonstrate Vizro-AI" src="https://raw.githubusercontent.com/mckinsey/vizro/main/.github/images/toolkit_vizro_ai_fallback.png" width="600">
</picture>

## Installation and first steps

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ skip = "*.min.css.map,*.min.css,.vale/*, *assets/*,.github/*"
[tool.mypy]
# strict checks : strict = true
check_untyped_defs = true
disable_error_code = "call-arg" # https://github.com/python/mypy/issues/14850 seems to not fix it
disallow_any_generics = true
disallow_incomplete_defs = false
disallow_subclassing_any = false
Expand Down
Loading

0 comments on commit 7002214

Please sign in to comment.