Skip to content

Commit 36c985d

Browse files
committed
add matrix to test both pandas 1 and 2
1 parent 66f378c commit 36c985d

3 files changed

Lines changed: 4338 additions & 2161 deletions

File tree

.github/workflows/run-pytest.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
run: |
5555
uv venv
5656
source .venv/bin/activate
57-
uv sync --extra dev_optional
57+
uv sync --extra dev_optional --extra dev_pandas3
5858
python --version
5959
- name: Test core
6060
run: |
@@ -82,14 +82,22 @@ jobs:
8282
python -m pytest -x test_init/test_lazy_imports.py
8383
8484
test-optional-legacy-pandas:
85-
name: Optional tests, Pandas 1 (Python 3.9, Pandas 1.2.4)
85+
name: Optional tests (Python ${{ matrix.python-version }}, pandas ${{ matrix.pandas-version }})
8686
runs-on: ubuntu-latest
87+
strategy:
88+
fail-fast: false
89+
matrix:
90+
include:
91+
- python-version: "3.9"
92+
pandas-version: "1"
93+
- python-version: "3.11"
94+
pandas-version: "2"
8795
steps:
8896
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8997
- name: Set up Python
9098
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
9199
with:
92-
python-version: "3.9"
100+
python-version: ${{ matrix.python-version }}
93101
- name: Set up Chrome for browser tests
94102
uses: ./.github/actions/setup-chrome-for-pytest
95103
- name: Set up uv
@@ -98,8 +106,7 @@ jobs:
98106
run: |
99107
uv venv
100108
source .venv/bin/activate
101-
uv sync --extra dev_optional
102-
uv pip install pandas==1.2.4 numpy==1.26.4
109+
uv sync --extra dev_optional --extra dev_pandas${{ matrix.pandas-version }}
103110
- name: Test core
104111
run: |
105112
source .venv/bin/activate
@@ -126,7 +133,7 @@ jobs:
126133
python -m pytest -x test_init/test_lazy_imports.py
127134
128135
test-kaleido-v0:
129-
name: Optional tests (Kaleido only), Kaleido v0 (Python 3.12, Kaleido v0.2.1)
136+
name: Optional tests (Kaleido only), Kaleido v0 (Python 3.12, kaleido==0.2.1)
130137
runs-on: ubuntu-latest
131138
steps:
132139
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

pyproject.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,26 @@ dev = [
8383
"plotly[dev_optional]"
8484
]
8585

86+
# The following extras are intended for use in CI only
87+
dev_pandas1 = [
88+
"pandas>=1,<2",
89+
"numpy>=1,<2",
90+
"setuptools<82"
91+
]
92+
dev_pandas2 = [
93+
"pandas>=2,<3",
94+
]
95+
dev_pandas3 = [
96+
"pandas>=3;python_version>='3.11'",
97+
]
98+
8699
[tool.uv]
87100
exclude-newer = "72 hours"
101+
conflicts = [
102+
[{ extra = "dev_pandas1" }, { extra = "dev_pandas2" }],
103+
[{ extra = "dev_pandas1" }, { extra = "dev_pandas3" }],
104+
[{ extra = "dev_pandas2" }, { extra = "dev_pandas3" }],
105+
]
88106

89107
[project.scripts]
90108
plotly_get_chrome = "plotly.io._kaleido:plotly_get_chrome"

0 commit comments

Comments
 (0)