Skip to content

Commit 86fd58c

Browse files
committed
Make sure test matrix is consistent
across the board and add the codestyle check. Fix PEP 8 complaints. Auto-cancel duplicate Action jobs.
1 parent dfa69c6 commit 86fd58c

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

.github/workflows/ci_workflows.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ on:
77
# Run every Sunday at 06:53 UTC
88
- cron: 53 6 * * 0
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
1014
jobs:
1115
tests:
1216
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
1317
with:
1418
envs: |
19+
- linux: codestyle
1520
- linux: py37-test-pytestoldest
1621
- macos: py37-test-pytest50
1722
- windows: py38-test-pytest52
@@ -24,7 +29,7 @@ jobs:
2429
- linux: py310-test-pytest72
2530
- macos: py310-test-pytest73
2631
- windows: py311-test-pytest74
27-
- linux: py312-test-pytestdev
32+
- linux: py312-test-devdeps
2833
publish:
2934
needs: tests
3035
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1

pytest_arraydiff/plugin.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
#
2929
# https://github.com/astrofrog/pytest-mpl
3030

31-
32-
from functools import wraps
33-
3431
import os
3532
import abc
3633
import shutil
@@ -149,7 +146,7 @@ def read(filename):
149146

150147
@staticmethod
151148
def write(filename, data, **kwargs):
152-
import pandas as pd
149+
import pandas as pd # noqa: F401
153150
key = os.path.basename(filename).replace('.h5', '')
154151
return data.to_hdf(filename, key, **kwargs)
155152

@@ -201,7 +198,7 @@ def pytest_addoption(parser):
201198
def pytest_configure(config):
202199
config.getini('markers').append(
203200
'array_compare: for functions using array comparison')
204-
201+
205202
if config.getoption("--arraydiff") or config.getoption("--arraydiff-generate-path") is not None:
206203

207204
reference_dir = config.getoption("--arraydiff-reference-path")

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ classifiers =
1616
Programming Language :: Python :: 3.8
1717
Programming Language :: Python :: 3.9
1818
Programming Language :: Python :: 3.10
19+
Programming Language :: Python :: 3.11
20+
Programming Language :: Python :: 3.12
1921
Programming Language :: Python :: Implementation :: CPython
2022
Topic :: Software Development :: Testing
2123
Topic :: Utilities

tox.ini

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
envlist =
3-
py{37,38,39,310,311}-test{,-devdeps}
3+
py{37,38,39,310,311,312}-test{,-pytestoldest,-pytest50,-pytest52,-pytest53,-pytest60,-pytest61,-pytest62,-pytest70,-pytest71,-pytest72,-pytest73,-pytest74,-devdeps}
44
codestyle
55
requires =
66
setuptools >= 30.3.0
@@ -10,8 +10,7 @@ isolated_build = true
1010
[testenv]
1111
changedir = .tmp/{envname}
1212
setenv =
13-
# Until a released numpy version is 3.12 compatible, we install the dev wheel
14-
py312: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
13+
devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
1514
description = run tests
1615
deps =
1716
pytestoldest: pytest==4.6.0
@@ -26,17 +25,20 @@ deps =
2625
pytest72: pytest==7.2.*
2726
pytest73: pytest==7.3.*
2827
pytest74: pytest==7.4.*
29-
pytestdev: git+https://github.com/pytest-dev/pytest#egg=pytest
30-
py312: numpy>=0.0.dev0
28+
devdeps: git+https://github.com/pytest-dev/pytest#egg=pytest
29+
devdeps: numpy>=0.0.dev0
3130
extras =
3231
test
3332
commands =
33+
# Force numpy-dev after something in the stack downgrades it
34+
devdeps: python -m pip install --pre --upgrade --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
3435
pip freeze
3536
pytest {toxinidir}/tests {posargs}
3637
pytest {toxinidir}/tests --arraydiff {posargs}
3738

3839
[testenv:codestyle]
3940
skip_install = true
41+
changedir = {toxinidir}
4042
description = check code style, e.g. with flake8
4143
deps = flake8
4244
commands = flake8 pytest_arraydiff --count

0 commit comments

Comments
 (0)