Skip to content

set up workflows to test numpy 1.x and 2.0 #971

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

Merged
merged 3 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions .github/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ inputs:
required: true
os:
required: true
numpy-version:
required: true

runs:
using: composite
Expand Down Expand Up @@ -33,3 +35,7 @@ runs:
- name: Install project dependencies
shell: bash
run: poetry install -vvv --no-root

- name: Set numpy version
shell: bash
run: pip install numpy"${{ inputs. numpy-version }}"
45 changes: 26 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Test'
name: "Test"

on:
push:
Expand All @@ -8,7 +8,7 @@ on:
workflow_dispatch:

env:
MPLBACKEND: 'Agg'
MPLBACKEND: "Agg"

jobs:
released:
Expand All @@ -19,34 +19,41 @@ jobs:
matrix:
# Don't use macos-latest because it is arm64
os: [ubuntu-latest, windows-latest, macos-13]
python-version: ['3.9', '3.10', '3.11', '3.12']
python-version: ["3.9", "3.10", "3.11", "3.12"]
include:
- numpy-version: "<2.0"
- numpy-version: ">= 2.0"
os: ubuntu-latest

name: OS ${{ matrix.os }} - Python ${{ matrix.python-version }} - Numpy ${{ matrix.numpy-version }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Install project dependencies
uses: ./.github/setup
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
- name: Install project dependencies
uses: ./.github/setup
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
numpy-version: ${{ matrix.numpy-version }}

- name: Run mypy on 'tests' (using the local stubs) and on the local stubs
run: poetry run poe mypy
- name: Run mypy on 'tests' (using the local stubs) and on the local stubs
run: poetry run poe mypy

- name: Run pyright on 'tests' (using the local stubs) and on the local stubs
run: poetry run poe pyright
- name: Run pyright on 'tests' (using the local stubs) and on the local stubs
run: poetry run poe pyright

- name: Run pytest
run: poetry run poe pytest
- name: Run pytest
run: poetry run poe pytest

- name: Install pandas-stubs and run tests on the installed stubs
run: poetry run poe test_dist
- name: Install pandas-stubs and run tests on the installed stubs
run: poetry run poe test_dist

precommit:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

- uses: pre-commit/[email protected]
- uses: pre-commit/[email protected]
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ packages = [{ "include" = "pandas-stubs" }]
[tool.poetry.dependencies]
python = ">=3.9"
types-pytz = ">= 2022.1.1"
numpy = [
{ version = ">=1.23.5,<2.0.0", python = ">=3.9,<3.12" },
{ version = ">=2.0.0", python = ">=3.12,<3.13" },
]
numpy = ">= 1.23.5"

[tool.poetry.group.dev.dependencies]
mypy = "1.10.1"
Expand Down
Loading