Skip to content

fix: configure() no longer overwrites config set by configure_*() sub-methods #122

fix: configure() no longer overwrites config set by configure_*() sub-methods

fix: configure() no longer overwrites config set by configure_*() sub-methods #122

Workflow file for this run

name: Tests
on:
push:
branches:
- main
pull_request:
env:
UV_SYSTEM_PYTHON: 1
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13", "3.14"]
required-dependencies: ["minimum", "latest"]
name: py ${{ matrix.python-version }} with ${{ matrix.required-dependencies }} required deps
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v7
# Install dependencies from pyproject.toml (latest versions for all matrix jobs)
- name: Install dependencies
run: uv pip install -e ".[dev, all]"
# Install minimum required versions for compatibility testing (only for 'minimum' matrix value)
- name: Pin minimum dependency versions
if: ${{ matrix.required-dependencies == 'minimum' }}
run: |
# Keep in sync with versions in `pyproject.toml`
uv pip install jsonschema==3.0 narwhals==1.27.1 typing_extensions==4.12.0 setuptools==81.0.0
- name: Maybe uninstall optional dependencies
# We uninstall pyarrow and vegafusion for one job to test that we have not
# accidentally introduced a hard dependency on these libraries.
# Uninstalling for Python 3.11 is an arbitrary choice.
# Also see https://github.com/vega/altair/pull/3114
if: ${{ matrix.python-version == '3.11' }}
run: |
uv pip uninstall pyarrow vegafusion vl-convert-python anywidget
- name: Maybe install lowest supported pandas version
# We install the lowest supported pandas version for one job to test that
# it still works. Downgrade to the oldest versions of pandas and numpy that include
# Python 3.11 wheels, so only run this job for Python 3.11
if: ${{ matrix.python-version == '3.11' }}
run: |
uv pip install pandas==1.5.3 numpy==1.23.5
- name: Test that schema generation has no effect
run: |
uv pip install vl-convert-python
python tools/generate_schema_wrapper.py
# This gets the paths of all files which were either deleted, modified
# or are not yet tracked by Git
files=$(git ls-files --deleted --modified --others --exclude-standard)
# Exclude dataset metadata that is regenerated by the script; parquet output
# can differ across platforms/Polars versions (binary non-determinism).
exclude_pattern='altair/datasets/_metadata/metadata\.parquet'
files_filtered=$(echo "$files" | grep -v -E "^${exclude_pattern}$" || true)
# Depending on the shell it can happen that 'files' contains empty
# lines which are filtered out in the for loop below
files_cleaned=()
while IFS= read -r i; do
# Skip empty items
[ -z "$i" ] && continue
files_cleaned+=("$i")
done <<< "$files_filtered"
if [ ${#files_cleaned[@]} -gt 0 ]; then
echo "The code generation modified the following files:"
printf '%s\n' "${files_cleaned[@]}"
git diff
exit 1
fi
- name: Test with pytest
run: |
uv run pytest --pyargs --numprocesses=logical --doctest-modules --doctest-ignore-import-errors tests
- name: Validate Vega-Lite schema
run: |
# We install all 'format' dependencies of jsonschema as check-jsonschema
# only does the 'format' checks which are installed.
# We can always use the latest jsonschema version here.
# uri-reference check is disabled as the URIs in the Vega-Lite schema do
# not conform RFC 3986.
uv pip install 'jsonschema[format]' check-jsonschema --upgrade
uv run check-jsonschema --check-metaschema altair/vegalite/v6/schema/vega-lite-schema.json --disable-formats uri-reference
- name: Show installed versions
run: uv pip list
# Branch protection requires one stable check name; this aggregates the test matrix.
check-all-tests:
name: Check that all tests passed
runs-on: ubuntu-latest
needs: test
if: ${{ always() }}
steps:
- name: Check matrix result
run: |
if [ "${{ needs.test.result }}" != "success" ]; then
exit 1
fi