Skip to content

Commit 754a8bd

Browse files
committed
Need astropy-dev and pandas-dev to go with numpy-dev
Handle FutureWarning from pandas 3.0 Skip failing pandas test caused by numpy 2.0 Updated matrix to run a stable job in py312
1 parent 86fd58c commit 754a8bd

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

.github/workflows/ci_workflows.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ jobs:
2323
- linux: py38-test-pytest53
2424
- macos: py39-test-pytest60
2525
- windows: py39-test-pytest61
26-
- linux: py39-test-pytest62
26+
- linux: py310-test-pytest62
2727
- macos: py310-test-pytest70
2828
- windows: py310-test-pytest71
29-
- linux: py310-test-pytest72
30-
- macos: py310-test-pytest73
31-
- windows: py311-test-pytest74
29+
- linux: py311-test-pytest72
30+
- macos: py311-test-pytest73
31+
- windows: py312-test-pytest74
3232
- linux: py312-test-devdeps
3333
publish:
3434
needs: tests

pytest_arraydiff/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def read(filename):
148148
def write(filename, data, **kwargs):
149149
import pandas as pd # noqa: F401
150150
key = os.path.basename(filename).replace('.h5', '')
151-
return data.to_hdf(filename, key, **kwargs)
151+
return data.to_hdf(filename, key=key, **kwargs)
152152

153153
@classmethod
154154
def compare(cls, reference_file, test_file, atol=None, rtol=None):

tests/test_pytest_arraydiff.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
import pytest
66
import numpy as np
7+
from packaging.version import Version
8+
9+
NUMPY_LT_2_0 = Version(np.__version__) < Version("2.0.dev")
710

811
reference_dir = 'baseline'
912

@@ -18,6 +21,7 @@ def test_succeeds_func_text():
1821
return np.arange(3 * 5).reshape((3, 5))
1922

2023

24+
@pytest.mark.skipif(not NUMPY_LT_2_0, reason="AttributeError: `np.unicode_` was removed in the NumPy 2.0 release. Use `np.str_` instead.")
2125
@pytest.mark.array_compare(file_format='pd_hdf', reference_dir=reference_dir)
2226
def test_succeeds_func_pdhdf():
2327
pd = pytest.importorskip('pandas')

tox.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ isolated_build = true
1010
[testenv]
1111
changedir = .tmp/{envname}
1212
setenv =
13-
devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
13+
devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
1414
description = run tests
1515
deps =
1616
pytestoldest: pytest==4.6.0
@@ -27,6 +27,8 @@ deps =
2727
pytest74: pytest==7.4.*
2828
devdeps: git+https://github.com/pytest-dev/pytest#egg=pytest
2929
devdeps: numpy>=0.0.dev0
30+
devdeps: pandas>=0.0.dev0
31+
devdeps: astropy>=0.0.dev0
3032
extras =
3133
test
3234
commands =

0 commit comments

Comments
 (0)