name: Test on: push: branches: - main pull_request: types: [opened, reopened, synchronize] permissions: contents: read jobs: test-core: name: Core tests (Python ${{ matrix.python-version }}) runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Set up Python uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ matrix.python-version }} - name: Set up uv uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0 - name: Install dependencies run: | uv venv source .venv/bin/activate uv lock --check uv sync --locked --extra dev_core python --version - name: Test core run: | source .venv/bin/activate python -m pytest tests/test_core test-optional: name: Optional tests (Python ${{ matrix.python-version }}) runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Set up Python uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ matrix.python-version }} - name: Set up Chrome for Pytest uses: ./.github/actions/setup-chrome-for-pytest - name: Set up uv uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0 - name: Install dependencies run: | uv venv source .venv/bin/activate uv sync --locked --extra dev_optional --extra dev_pandas3 python --version - name: Test core run: | source .venv/bin/activate python -m pytest tests/test_core - name: Test optional run: | source .venv/bin/activate python -m pytest tests/test_optional - name: Test utils run: | source .venv/bin/activate python -m pytest tests/test_plotly_utils/ - name: Test io run: | source .venv/bin/activate python -m pytest tests/test_io - name: Test dependencies not imported run: | source .venv/bin/activate python -m pytest -x test_init/test_dependencies_not_imported.py - name: Test lazy imports run: | source .venv/bin/activate python -m pytest -x test_init/test_lazy_imports.py test-optional-legacy-pandas: name: Optional tests (Python ${{ matrix.python-version }}, pandas ${{ matrix.pandas-version }}) runs-on: ubuntu-latest strategy: fail-fast: false matrix: include: - python-version: "3.9" pandas-version: "1" - python-version: "3.11" pandas-version: "2" steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Set up Python uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ matrix.python-version }} - name: Set up Chrome for browser tests uses: ./.github/actions/setup-chrome-for-pytest - name: Set up uv uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0 - name: Install dependencies run: | uv venv source .venv/bin/activate uv sync --locked --extra dev_optional --extra dev_pandas${{ matrix.pandas-version }} - name: Test core run: | source .venv/bin/activate python -m pytest tests/test_core - name: Test optional run: | source .venv/bin/activate python -m pytest tests/test_optional - name: Test utils run: | source .venv/bin/activate python -m pytest tests/test_plotly_utils/ - name: Test io run: | source .venv/bin/activate python -m pytest tests/test_io - name: Test dependencies not imported run: | source .venv/bin/activate python -m pytest -x test_init/test_dependencies_not_imported.py - name: Test lazy imports run: | source .venv/bin/activate python -m pytest -x test_init/test_lazy_imports.py test-kaleido-v0: name: Kaleido v0 RuntimeError verification (Python 3.12, kaleido 0.2.1) runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Set up Python uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: "3.12" - name: Set up Chrome uses: browser-actions/setup-chrome@48ad923757ca74d66703209fe939badbdf80f2f4 # v2.2.0 with: install-chromedriver: true - name: Set up uv uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0 - name: Install dependencies run: | uv venv source .venv/bin/activate uv sync --locked --extra dev_optional uv pip uninstall kaleido uv pip install kaleido==0.2.1 python --version - name: Test that plotly.io raises correct error with Kaleido v0 run: | source .venv/bin/activate python -m pytest tests/test_optional/test_kaleido/test_kaleido_v0_error.py test-matplotlylib: name: Matplotlylib tests (Python ${{ matrix.python-version }}) runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Set up Python uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ matrix.python-version }} - name: Set up uv uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0 - name: Install dependencies run: | uv venv source .venv/bin/activate uv lock --check uv sync --locked --extra dev_matplotlib python --version - name: Test matplotlylib run: | source .venv/bin/activate python -m pytest plotly/matplotlylib/tests plotly/matplotlylib/mplexporter/tests