Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Windows paths #837

Merged
merged 34 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c714bfd
Fix asset paths on Windows
antonymilne Oct 29, 2024
cf725dc
Bump version
antonymilne Oct 29, 2024
c7c0e2b
Another small fix
antonymilne Oct 29, 2024
0fb311a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 29, 2024
6cdf3d6
Run tests on windows
antonymilne Oct 29, 2024
93a802b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 29, 2024
7cb0c7c
Try again
antonymilne Oct 29, 2024
9dab047
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 29, 2024
5ec50a6
Run tests on windows
antonymilne Oct 29, 2024
b9b4972
Run tests on windows
antonymilne Oct 29, 2024
ebed348
Tidy config
antonymilne Oct 29, 2024
5855673
All the tests
antonymilne Oct 29, 2024
493644e
Fix
antonymilne Oct 29, 2024
7bc52ce
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 29, 2024
b0db4e7
Test to see what jobs run
antonymilne Oct 29, 2024
ca4ca33
Test to see what jobs run
antonymilne Oct 29, 2024
d16ddd3
Test to see what jobs run
antonymilne Oct 29, 2024
b528940
Test to see what jobs run
antonymilne Oct 29, 2024
af9233b
Test to see what jobs run
antonymilne Oct 29, 2024
3bfec30
Test to see what jobs run
antonymilne Oct 29, 2024
3a2bf44
Test to see what jobs run
antonymilne Oct 29, 2024
55e4767
Test to see what jobs run
antonymilne Oct 29, 2024
644e080
Test to see what jobs run
antonymilne Oct 29, 2024
38f86f4
Test to see what jobs run
antonymilne Oct 29, 2024
48f2ff8
Test to see what jobs run
antonymilne Oct 29, 2024
248a070
Try same logic on all workflows
antonymilne Oct 29, 2024
308d9ed
Remove 3.13 for VizroAI
antonymilne Oct 29, 2024
36bc767
Urgh
antonymilne Oct 29, 2024
eae7dd4
Fix VizroAI integration tests
antonymilne Oct 29, 2024
ee5e59f
Fix a few more bits
antonymilne Oct 29, 2024
265be4d
Check fix is working
antonymilne Oct 29, 2024
d281fb6
Prepare for merge
antonymilne Oct 29, 2024
70c9f88
Merge branch 'main' into fix/windows-paths
antonymilne Oct 29, 2024
3364a69
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 69 additions & 25 deletions .github/workflows/test-integration-vizro-ai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,46 @@ env:
jobs:
test-integration-vizro-ai-fork:
if: ${{ github.event.pull_request.head.repo.fork }}
name: test-integration-vizro-ai on Py${{ matrix.python-version }} ${{ matrix.label }}
runs-on: ubuntu-latest
name: test-integration-vizro-ai on Py${{ matrix.config.python-version }} ${{ matrix.config.label }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
include:
# This is not a nice way to define the matrix, but it's the only way that's possible so that we only run
# the job on Windows on merge to main rather than in every PR. See:
# https://stackoverflow.com/questions/66025220/paired-values-in-github-actions-matrix
# https://github.com/orgs/community/discussions/26253
# https://github.com/actions/runner/issues/1985
config:
- python-version: "3.9"
hatch-env: all.py3.9
os: ubuntu-latest
- python-version: "3.10"
hatch-env: all.py3.10
os: ubuntu-latest
- python-version: "3.11"
hatch-env: all.py3.11
os: ubuntu-latest
- python-version: "3.12"
hatch-env: all.py3.12
os: ubuntu-latest
- python-version: "3.9"
hatch-env: lower-bounds
os: ubuntu-latest
label: lower bounds
- python-version: "3.12"
hatch-env: all.py3.12
os: windows-latest
label: Windows
is_pr:
- ${{ github.event_name == 'pull_request' }}
exclude:
- is_pr: true
config:
python-version: "3.12"
hatch-env: all.py3.12
os: windows-latest
label: Windows

steps:
- uses: actions/checkout@v4
Expand All @@ -47,55 +70,76 @@ jobs:

test-integration-vizro-ai:
if: ${{ ! github.event.pull_request.head.repo.fork }}
name: test-integration-vizro-ai on Py${{ matrix.python-version }} ${{ matrix.label }}
runs-on: ubuntu-latest
name: test-integration-vizro-ai on Py${{ matrix.config.python-version }} ${{ matrix.config.label }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
include:
# This is not a nice way to define the matrix, but it's the only way that's possible so that we only run
# the job on Windows on merge to main rather than in every PR. See:
# https://stackoverflow.com/questions/66025220/paired-values-in-github-actions-matrix
# https://github.com/orgs/community/discussions/26253
# https://github.com/actions/runner/issues/1985
config:
- python-version: "3.9"
hatch-env: all.py3.9
os: ubuntu-latest
- python-version: "3.10"
hatch-env: all.py3.10
os: ubuntu-latest
- python-version: "3.11"
hatch-env: all.py3.11
os: ubuntu-latest
- python-version: "3.12"
hatch-env: all.py3.12
os: ubuntu-latest
- python-version: "3.9"
hatch-env: lower-bounds
os: ubuntu-latest
label: lower bounds
- python-version: "3.12"
hatch-env: all.py3.12
os: windows-latest
label: Windows
is_pr:
- ${{ github.event_name == 'pull_request' }}
exclude:
- is_pr: true
config:
python-version: "3.12"
hatch-env: all.py3.12
os: windows-latest
label: Windows

steps:
- uses: actions/checkout@v4

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

- name: Install Hatch
run: pip install hatch

- name: Show dependency tree
run: hatch run ${{ matrix.hatch-env }}:pip tree
run: hatch run ${{ matrix.config.hatch-env }}:pip tree

- name: Run vizro-ai integration tests with pypi vizro
run: |
export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}
export OPENAI_API_BASE=${{ secrets.OPENAI_API_BASE }}
export VIZRO_TYPE=pypi
hatch run ${{ matrix.hatch-env }}:test-integration
- name: Run vizro-ai integration tests with PyPI vizro
run: hatch run ${{ matrix.config.hatch-env }}:test-integration
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }}
VIZRO_TYPE: pypi
Comment on lines +130 to +133
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @l0uden this is a better way to define environment variables in GHA because it works on all OS.


- name: Run vizro-ai integration tests with local vizro
run: |
export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}
export OPENAI_API_BASE=${{ secrets.OPENAI_API_BASE }}
export VIZRO_TYPE=local
cd ../vizro-core
hatch build
cd ../vizro-ai
hatch run ${{ matrix.hatch-env }}:pip install ../vizro-core/dist/vizro*.tar.gz
hatch run ${{ matrix.hatch-env }}:test-integration
hatch run ${{ matrix.config.hatch-env }}:pip install ../vizro-core
hatch run ${{ matrix.config.hatch-env }}:test-integration
Comment on lines +137 to +138
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @l0uden I tidied this up by just installing vizro-core directly - no need to build it first.

env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }}
VIZRO_TYPE: local

- name: Send custom JSON data to Slack
id: slack
Expand All @@ -104,7 +148,7 @@ jobs:
with:
payload: |
{
"text": "Vizro-ai ${{ matrix.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 }} integration 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 @@ -114,6 +158,6 @@ jobs:
uses: actions/upload-artifact@v4
if: always()
with:
name: Report-${{ matrix.python-version }}-${{ matrix.label }}
name: Report-${{ matrix.config.python-version }}-${{ matrix.config.label }}
path: |
/home/runner/work/vizro/vizro/vizro-ai/tests/integration/reports/report*.csv
38 changes: 31 additions & 7 deletions .github/workflows/test-integration-vizro-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,64 @@ env:

jobs:
test-integration-vizro-core:
name: test-integration-vizro-core on Py${{ matrix.python-version }} ${{ matrix.label }}
name: test-integration-vizro-core on Py${{ matrix.config.python-version }} ${{ matrix.config.label }}

runs-on: ubuntu-latest
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
include:
# This is not a nice way to define the matrix, but it's the only way that's possible so that we only run
# the job on Windows on merge to main rather than in every PR. See:
# https://stackoverflow.com/questions/66025220/paired-values-in-github-actions-matrix
# https://github.com/orgs/community/discussions/26253
# https://github.com/actions/runner/issues/1985
config:
- python-version: "3.9"
hatch-env: all.py3.9
os: ubuntu-latest
- python-version: "3.10"
hatch-env: all.py3.10
os: ubuntu-latest
- python-version: "3.11"
hatch-env: all.py3.11
os: ubuntu-latest
- python-version: "3.12"
hatch-env: all.py3.12
os: ubuntu-latest
- python-version: "3.13"
hatch-env: all.py3.13
os: ubuntu-latest
- python-version: "3.9"
hatch-env: lower-bounds
os: ubuntu-latest
label: lower bounds
- python-version: "3.12"
hatch-env: all.py3.12
os: windows-latest
label: Windows
is_pr:
- ${{ github.event_name == 'pull_request' }}
exclude:
- is_pr: true
config:
python-version: "3.12"
hatch-env: all.py3.12
os: windows-latest
label: Windows

steps:
- uses: actions/checkout@v4

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

- name: Install Hatch
run: pip install hatch

- name: Show dependency tree
run: hatch run ${{ matrix.hatch-env }}:pip tree
run: hatch run ${{ matrix.config.hatch-env }}:pip tree

- name: Run integration tests
run: hatch run ${{ matrix.hatch-env }}:test-integration
run: hatch run ${{ matrix.config.hatch-env }}:test-integration
37 changes: 30 additions & 7 deletions .github/workflows/test-unit-vizro-ai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,61 @@ env:

jobs:
test-unit-vizro-ai:
name: test-unit-vizro-ai on Py${{ matrix.python-version }} ${{ matrix.label }}
name: test-unit-vizro-ai on Py${{ matrix.config.python-version }} ${{ matrix.config.label }}

runs-on: ubuntu-latest
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
include:
# This is not a nice way to define the matrix, but it's the only way that's possible so that we only run
# the job on Windows on merge to main rather than in every PR. See:
# https://stackoverflow.com/questions/66025220/paired-values-in-github-actions-matrix
# https://github.com/orgs/community/discussions/26253
# https://github.com/actions/runner/issues/1985
config:
- python-version: "3.9"
hatch-env: all.py3.9
os: ubuntu-latest
- python-version: "3.10"
hatch-env: all.py3.10
os: ubuntu-latest
- python-version: "3.11"
hatch-env: all.py3.11
os: ubuntu-latest
- python-version: "3.12"
hatch-env: all.py3.12
os: ubuntu-latest
- python-version: "3.9"
hatch-env: lower-bounds
os: ubuntu-latest
label: lower bounds
- python-version: "3.12"
hatch-env: all.py3.12
os: windows-latest
label: Windows
is_pr:
- ${{ github.event_name == 'pull_request' }}
exclude:
- is_pr: true
config:
python-version: "3.12"
hatch-env: all.py3.12
os: windows-latest
label: Windows

steps:
- uses: actions/checkout@v4

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

- name: Install Hatch
run: pip install hatch

- name: Show dependency tree
run: hatch run ${{ matrix.hatch-env }}:pip tree
run: hatch run ${{ matrix.config.hatch-env }}:pip tree

- name: Run unit tests
run: hatch run ${{ matrix.hatch-env }}:test-unit-coverage
run: hatch run ${{ matrix.config.hatch-env }}:test-unit-coverage
38 changes: 31 additions & 7 deletions .github/workflows/test-unit-vizro-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,64 @@ env:

jobs:
test-unit-vizro-core:
name: test-unit-vizro-core on Py${{ matrix.python-version }} ${{ matrix.label }}
name: test-unit-vizro-core on Py${{ matrix.config.python-version }} ${{ matrix.config.label }}

runs-on: ubuntu-latest
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
include:
# This is not a nice way to define the matrix, but it's the only way that's possible so that we only run
# the job on Windows on merge to main rather than in every PR. See:
# https://stackoverflow.com/questions/66025220/paired-values-in-github-actions-matrix
# https://github.com/orgs/community/discussions/26253
# https://github.com/actions/runner/issues/1985
config:
- python-version: "3.9"
hatch-env: all.py3.9
os: ubuntu-latest
- python-version: "3.10"
hatch-env: all.py3.10
os: ubuntu-latest
- python-version: "3.11"
hatch-env: all.py3.11
os: ubuntu-latest
- python-version: "3.12"
hatch-env: all.py3.12
os: ubuntu-latest
- python-version: "3.13"
hatch-env: all.py3.13
os: ubuntu-latest
- python-version: "3.9"
hatch-env: lower-bounds
os: ubuntu-latest
label: lower bounds
- python-version: "3.12"
hatch-env: all.py3.12
os: windows-latest
label: Windows
is_pr:
- ${{ github.event_name == 'pull_request' }}
exclude:
- is_pr: true
config:
python-version: "3.12"
hatch-env: all.py3.12
os: windows-latest
label: Windows

steps:
- uses: actions/checkout@v4

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

- name: Install Hatch
run: pip install hatch

- name: Show dependency tree
run: hatch run ${{ matrix.hatch-env }}:pip tree
run: hatch run ${{ matrix.config.hatch-env }}:pip tree

- name: Run unit tests
run: hatch run ${{ matrix.hatch-env }}:test-unit-coverage
run: hatch run ${{ matrix.config.hatch-env }}:test-unit-coverage
4 changes: 2 additions & 2 deletions vizro-ai/hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ example = "cd examples; python example.py"
example-create-dashboard = "cd examples; python example_dashboard.py"
example-ui = "cd examples/dashboard_ui; python app.py"
lint = "pre-commit run {args} --all-files"
pip = "'{env:HATCH_UV}' pip {args}"
pip = '"{env:HATCH_UV}" pip {args}'
prep-release = [
"hatch version release",
"hatch run changelog:collect",
Expand Down Expand Up @@ -73,7 +73,7 @@ build = "mkdocs build --strict"
# more advanced settings using a linkcheckerrc config file. openai.com doesn't seem to work well with linkchecking,
# throwing 403 errors, but these are not real errors.
link-check = "linkchecker site --check-extern --no-warnings --ignore=404.html --ignore-url=127.0.0.1 --ignore-url=https://vizro.readthedocs.io/ --ignore-url=https://platform.openai.com/docs/models --ignore-url=openai.com --ignore-url=https://openai.com/"
pip = "'{env:HATCH_UV}' pip {args}"
pip = '"{env:HATCH_UV}" pip {args}'
serve = "mkdocs serve --open"

[envs.lower-bounds]
Expand Down
Loading