Skip to content

Commit f16e7bf

Browse files
authored
set up workflows to test numpy 1.x and 2.0 (pandas-dev#971)
* set up workflows to test numpy 1.x and 2.0 * quotes around numpy requirements * spell version right
1 parent 1846b34 commit f16e7bf

File tree

3 files changed

+33
-23
lines changed

3 files changed

+33
-23
lines changed

.github/setup/action.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ inputs:
55
required: true
66
os:
77
required: true
8+
numpy-version:
9+
required: true
810

911
runs:
1012
using: composite
@@ -33,3 +35,7 @@ runs:
3335
- name: Install project dependencies
3436
shell: bash
3537
run: poetry install -vvv --no-root
38+
39+
- name: Set numpy version
40+
shell: bash
41+
run: pip install numpy"${{ inputs. numpy-version }}"

.github/workflows/test.yml

+26-19
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Test'
1+
name: "Test"
22

33
on:
44
push:
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch:
99

1010
env:
11-
MPLBACKEND: 'Agg'
11+
MPLBACKEND: "Agg"
1212

1313
jobs:
1414
released:
@@ -19,34 +19,41 @@ jobs:
1919
matrix:
2020
# Don't use macos-latest because it is arm64
2121
os: [ubuntu-latest, windows-latest, macos-13]
22-
python-version: ['3.9', '3.10', '3.11', '3.12']
22+
python-version: ["3.9", "3.10", "3.11", "3.12"]
23+
include:
24+
- numpy-version: "<2.0"
25+
- numpy-version: ">= 2.0"
26+
os: ubuntu-latest
27+
28+
name: OS ${{ matrix.os }} - Python ${{ matrix.python-version }} - Numpy ${{ matrix.numpy-version }}
2329

2430
steps:
25-
- uses: actions/checkout@v3
31+
- uses: actions/checkout@v3
2632

27-
- name: Install project dependencies
28-
uses: ./.github/setup
29-
with:
30-
os: ${{ matrix.os }}
31-
python-version: ${{ matrix.python-version }}
33+
- name: Install project dependencies
34+
uses: ./.github/setup
35+
with:
36+
os: ${{ matrix.os }}
37+
python-version: ${{ matrix.python-version }}
38+
numpy-version: ${{ matrix.numpy-version }}
3239

33-
- name: Run mypy on 'tests' (using the local stubs) and on the local stubs
34-
run: poetry run poe mypy
40+
- name: Run mypy on 'tests' (using the local stubs) and on the local stubs
41+
run: poetry run poe mypy
3542

36-
- name: Run pyright on 'tests' (using the local stubs) and on the local stubs
37-
run: poetry run poe pyright
43+
- name: Run pyright on 'tests' (using the local stubs) and on the local stubs
44+
run: poetry run poe pyright
3845

39-
- name: Run pytest
40-
run: poetry run poe pytest
46+
- name: Run pytest
47+
run: poetry run poe pytest
4148

42-
- name: Install pandas-stubs and run tests on the installed stubs
43-
run: poetry run poe test_dist
49+
- name: Install pandas-stubs and run tests on the installed stubs
50+
run: poetry run poe test_dist
4451

4552
precommit:
4653
runs-on: ubuntu-latest
4754
timeout-minutes: 10
4855

4956
steps:
50-
- uses: actions/checkout@v3
57+
- uses: actions/checkout@v3
5158

52-
- uses: pre-commit/[email protected]
59+
- uses: pre-commit/[email protected]

pyproject.toml

+1-4
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ packages = [{ "include" = "pandas-stubs" }]
3030
[tool.poetry.dependencies]
3131
python = ">=3.9"
3232
types-pytz = ">= 2022.1.1"
33-
numpy = [
34-
{ version = ">=1.23.5,<2.0.0", python = ">=3.9,<3.12" },
35-
{ version = ">=2.0.0", python = ">=3.12,<3.13" },
36-
]
33+
numpy = ">= 1.23.5"
3734

3835
[tool.poetry.group.dev.dependencies]
3936
mypy = "1.10.1"

0 commit comments

Comments
 (0)