Skip to content

Commit 84e5f20

Browse files
authored
Merge pull request #49 from bsipocz/MAINT_remove_py37
MAINT: remove py37
2 parents ed26435 + a2b64e4 commit 84e5f20

File tree

6 files changed

+24
-23
lines changed

6 files changed

+24
-23
lines changed

.github/workflows/ci_workflows.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ jobs:
1818
with:
1919
envs: |
2020
- linux: codestyle
21-
- linux: py37-test-pytestoldest
22-
- macos: py37-test-pytest50
23-
- windows: py38-test-pytest52
21+
- windows: py38-test-pytestoldest
2422
- linux: py38-test-pytest53
2523
- macos: py39-test-pytest60
2624
- windows: py39-test-pytest61

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
0.7 (unreleased)
2+
----------------
3+
4+
- Minimum Python version is now 3.8. [#49]
5+
16
0.6.1 (2023-11-27)
27
------------------
38

pytest_arraydiff/plugin.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
abstractclassmethod = abc.abstractclassmethod
4444

4545

46-
class BaseDiff(object, metaclass=abc.ABCMeta):
46+
class BaseDiff(metaclass=abc.ABCMeta):
4747

4848
@abstractstaticmethod
4949
def read(filename):
@@ -83,8 +83,8 @@ def compare(cls, reference_file, test_file, atol=None, rtol=None):
8383
try:
8484
np.testing.assert_allclose(array_ref, array_new, atol=atol, rtol=rtol)
8585
except AssertionError as exc:
86-
message = "\n\na: {0}".format(test_file) + '\n'
87-
message += "b: {0}".format(reference_file) + '\n'
86+
message = f"\n\na: {test_file}" + '\n'
87+
message += f"b: {reference_file}" + '\n'
8888
message += exc.args[0]
8989
return False, message
9090
else:
@@ -160,8 +160,8 @@ def compare(cls, reference_file, test_file, atol=None, rtol=None):
160160
try:
161161
pdt.assert_frame_equal(ref_data, test_data)
162162
except AssertionError as exc:
163-
message = "\n\na: {0}".format(test_file) + '\n'
164-
message += "b: {0}".format(reference_file) + '\n'
163+
message = f"\n\na: {test_file}" + '\n'
164+
message += f"b: {reference_file}" + '\n'
165165
message += exc.args[0]
166166
return False, message
167167
else:
@@ -251,7 +251,7 @@ def wrapper(*args, **kwargs):
251251
item.obj = array_interceptor(plugin, item.obj)
252252

253253

254-
class ArrayComparison(object):
254+
class ArrayComparison:
255255

256256
def __init__(self, config, reference_dir=None, generate_dir=None, default_format='text'):
257257
self.config = config
@@ -272,7 +272,7 @@ def pytest_runtest_call(self, item):
272272
file_format = compare.kwargs.get('file_format', self.default_format)
273273

274274
if file_format not in FORMATS:
275-
raise ValueError("Unknown format: {0}".format(file_format))
275+
raise ValueError(f"Unknown format: {file_format}")
276276

277277
if 'extension' in compare.kwargs:
278278
extension = compare.kwargs['extension']

setup.cfg

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ classifiers =
1212
Programming Language :: Python
1313
Programming Language :: Python :: 3
1414
Programming Language :: Python :: 3 :: Only
15-
Programming Language :: Python :: 3.7
1615
Programming Language :: Python :: 3.8
1716
Programming Language :: Python :: 3.9
1817
Programming Language :: Python :: 3.10
@@ -29,11 +28,11 @@ long_description_content_type = text/x-rst
2928
[options]
3029
zip_safe = False
3130
packages = find:
32-
python_requires = >=3.7
31+
python_requires = >=3.8
3332
setup_requires =
3433
setuptools_scm
3534
install_requires =
36-
pytest>=4.6
35+
pytest>=5.0
3736
numpy
3837

3938
# tables limitation is until 3.9.3 is out as that supports ARM OSX.
@@ -48,7 +47,7 @@ pytest11 =
4847
pytest_arraydiff = pytest_arraydiff.plugin
4948

5049
[tool:pytest]
51-
minversion = 4.6
50+
minversion = 5.0
5251
testpaths = tests
5352
xfail_strict = true
5453
markers =

tests/test_pytest_arraydiff.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test_succeeds_func_fits_hdu():
4040
return fits.PrimaryHDU(np.arange(3 * 5).reshape((3, 5)).astype(np.int64))
4141

4242

43-
class TestClass(object):
43+
class TestClass:
4444

4545
@pytest.mark.array_compare(file_format='fits', reference_dir=reference_dir)
4646
def test_succeeds_class(self):
@@ -66,11 +66,11 @@ def test_fails():
6666
f.write(TEST_FAILING)
6767

6868
# If we use --arraydiff, it should detect that the file is missing
69-
code = subprocess.call('pytest --arraydiff {0}'.format(test_file), shell=True)
69+
code = subprocess.call(f'pytest --arraydiff {test_file}', shell=True)
7070
assert code != 0
7171

7272
# If we don't use --arraydiff option, the test should succeed
73-
code = subprocess.call('pytest {0}'.format(test_file), shell=True)
73+
code = subprocess.call(f'pytest {test_file}', shell=True)
7474
assert code == 0
7575

7676

@@ -102,7 +102,7 @@ def test_generate(file_format):
102102
assert b'File not found for comparison test' in grepexc.output
103103

104104
# If we do generate, the test should succeed and a new file will appear
105-
code = subprocess.call(['pytest', '--arraydiff-generate-path={0}'.format(gen_dir), test_file],
105+
code = subprocess.call(['pytest', f'--arraydiff-generate-path={gen_dir}', test_file],
106106
timeout=10)
107107
assert code == 0
108108
assert os.path.exists(os.path.join(gen_dir, 'test_gen.' + ('fits' if file_format == 'fits' else 'txt')))
@@ -130,8 +130,8 @@ def test_default_format(file_format):
130130
gen_dir = os.path.join(tmpdir, 'spam', 'egg')
131131

132132
# If we do generate, the test should succeed and a new file will appear
133-
code = subprocess.call('pytest -s --arraydiff-default-format={0}'
134-
' --arraydiff-generate-path={1} {2}'.format(file_format, gen_dir, test_file), shell=True)
133+
code = subprocess.call('pytest -s --arraydiff-default-format={}'
134+
' --arraydiff-generate-path={} {}'.format(file_format, gen_dir, test_file), shell=True)
135135
assert code == 0
136136
assert os.path.exists(os.path.join(gen_dir, 'test_default.' + ('fits' if file_format == 'fits' else 'txt')))
137137

tox.ini

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
envlist =
3-
py{37,38,39,310,311,312}-test{,-pytestoldest,-pytest50,-pytest52,-pytest53,-pytest60,-pytest61,-pytest62,-pytest70,-pytest71,-pytest72,-pytest73,-pytest74,-devdeps}
3+
py{38,39,310,311,312}-test{,-pytestoldest,-pytest52,-pytest53,-pytest60,-pytest61,-pytest62,-pytest70,-pytest71,-pytest72,-pytest73,-pytest74,-devdeps}
44
codestyle
55
requires =
66
setuptools >= 30.3.0
@@ -13,8 +13,7 @@ setenv =
1313
devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/liberfa/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
1414
description = run tests
1515
deps =
16-
pytestoldest: pytest==4.6.0
17-
pytest50: pytest==5.0.*
16+
pytestoldest: pytest==5.0.0
1817
pytest52: pytest==5.2.*
1918
pytest53: pytest==5.3.*
2019
pytest60: pytest==6.0.*

0 commit comments

Comments
 (0)