Skip to content

Commit 95f1496

Browse files
authored
Merge pull request #274 from bsipocz/MAINT_drop_py38
MAINT: dropping python3.8 support
2 parents 8e26121 + 23eb3de commit 95f1496

File tree

9 files changed

+27
-39
lines changed

9 files changed

+27
-39
lines changed

.github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
fetch-depth: 0
2424
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
2525
with:
26-
python-version: 3.8
26+
python-version: '3.10'
2727

2828
- name: Install python-build and twine
2929
run: python -m pip install build "twine>=3.3"

.github/workflows/python-tests.yml

+9-21
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,17 @@ jobs:
2020
matrix:
2121
include:
2222
- os: ubuntu-latest
23-
python-version: '3.8'
24-
toxenv: py38-test-pytestoldest
23+
python-version: '3.9'
24+
toxenv: py39-test-pytestoldest
2525
- os: windows-latest
26-
python-version: '3.8'
27-
toxenv: py38-test-pytest50
26+
python-version: '3.9'
27+
toxenv: py39-test-pytest50
2828
- os: macos-13
29-
python-version: '3.8'
30-
toxenv: py38-test-pytest51
31-
- os: ubuntu-latest
32-
python-version: '3.8'
33-
toxenv: py38-test-pytest52
34-
- os: windows-latest
35-
python-version: '3.8'
36-
toxenv: py38-test-pytest53
37-
- os: ubuntu-latest
38-
python-version: '3.8'
39-
toxenv: py38-test-pytest60
29+
python-version: '3.9'
30+
toxenv: py39-test-pytest51
4031
- os: ubuntu-latest
4132
python-version: '3.9'
42-
toxenv: py39-test-pytest61
33+
toxenv: py39-test-pytest60
4334
- os: ubuntu-latest
4435
python-version: '3.9'
4536
toxenv: py39-test-pytest62
@@ -74,14 +65,11 @@ jobs:
7465
python-version: '3.13'
7566
toxenv: py313-test-pytestdev
7667
- os: macos-latest
77-
python-version: '3.11'
78-
toxenv: py311-test-pytestdev
79-
- os: ubuntu-latest
8068
python-version: '3.12'
81-
toxenv: py312-test-pytestdev-numpydev
69+
toxenv: py312-test-pytestdev
8270
- os: ubuntu-latest
8371
python-version: '3.13'
84-
toxenv: py313-test-pytestdev
72+
toxenv: py313-test-pytestdev-numpydev
8573

8674
steps:
8775
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

CHANGES.rst

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
1.4.0 (unreleased)
22
==================
33

4+
- Versions of Python <3.9 are no longer supported. [#274]
45

56
1.3.0 (2024-11-25)
67
==================

pytest_doctestplus/output_checker.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ def __init__(self):
6767
front_sep = r'\s|[*+-,<=(\[]'
6868
back_sep = front_sep + r'|[>j)\]}]'
6969

70-
fbeg = r'^{}(?={}|$)'.format(got_floats, back_sep)
71-
fmidend = r'(?<={}){}(?={}|$)'.format(front_sep, got_floats, back_sep)
72-
self.num_got_rgx = re.compile(r'({}|{})'.format(fbeg, fmidend))
70+
fbeg = fr'^{got_floats}(?={back_sep}|$)'
71+
fmidend = fr'(?<={front_sep}){got_floats}(?={back_sep}|$)'
72+
self.num_got_rgx = re.compile(fr'({fbeg}|{fmidend})')
7373

74-
fbeg = r'^{}(?={}|$)'.format(want_floats, back_sep)
75-
fmidend = r'(?<={}){}(?={}|$)'.format(front_sep, want_floats, back_sep)
76-
self.num_want_rgx = re.compile(r'({}|{})'.format(fbeg, fmidend))
74+
fbeg = fr'^{want_floats}(?={back_sep}|$)'
75+
fmidend = fr'(?<={front_sep}){want_floats}(?={back_sep}|$)'
76+
self.num_want_rgx = re.compile(fr'({fbeg}|{fmidend})')
7777

7878
# As of 2023-09-26, Python base class has no init, but just in case
7979
# it acquires one.
@@ -220,7 +220,7 @@ def normalize_floats(self, want, got, flags):
220220
# blank line, unless the DONT_ACCEPT_BLANKLINE flag is used.
221221
if not (flags & doctest.DONT_ACCEPT_BLANKLINE):
222222
# Replace <BLANKLINE> in want with a blank line.
223-
want = re.sub(r'(?m)^{}\s*?$'.format(re.escape(doctest.BLANKLINE_MARKER)),
223+
want = re.sub(fr'(?m)^{re.escape(doctest.BLANKLINE_MARKER)}\s*?$',
224224
'', want)
225225
# If a line in got contains only spaces, then remove the
226226
# spaces.

pytest_doctestplus/plugin.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ def write_modified_file(fname, new_fname, changes):
893893
changes.sort(key=lambda x: (x["test_lineno"], x["example_lineno"]),
894894
reverse=True)
895895

896-
with open(fname, "r") as f:
896+
with open(fname) as f:
897897
text = f.readlines()
898898

899899
for change in changes:
@@ -923,7 +923,7 @@ def write_modified_file(fname, new_fname, changes):
923923
def pytest_terminal_summary(terminalreporter, exitstatus, config):
924924
changesets = DebugRunnerPlus._changesets
925925
diff_mode = DebugRunnerPlus._generate_diff
926-
DebugRunnerPlus._changesets = defaultdict(lambda: [])
926+
DebugRunnerPlus._changesets = defaultdict(list)
927927
DebugRunnerPlus._generate_diff = None
928928
all_bad_tests = []
929929
if not diff_mode:
@@ -1004,7 +1004,7 @@ def pytest_terminal_summary(terminalreporter, exitstatus, config):
10041004

10051005

10061006
class DebugRunnerPlus(doctest.DebugRunner):
1007-
_changesets = defaultdict(lambda: [])
1007+
_changesets = defaultdict(list)
10081008
_generate_diff = False
10091009

10101010
def __init__(self, checker=None, verbose=None, optionflags=0,

setup.cfg

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ classifiers =
1111
Programming Language :: Python
1212
Programming Language :: Python :: 3
1313
Programming Language :: Python :: 3 :: Only
14-
Programming Language :: Python :: 3.8
1514
Programming Language :: Python :: 3.9
1615
Programming Language :: Python :: 3.10
1716
Programming Language :: Python :: 3.11
@@ -29,7 +28,7 @@ keywords = doctest, rst, pytest, py.test
2928
[options]
3029
zip_safe = False
3130
packages = find:
32-
python_requires = >=3.8
31+
python_requires = >=3.9
3332
setup_requires =
3433
setuptools_scm
3534
install_requires =

tests/python/doctests.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def depends_on_two_modules():
8080
"""
8181

8282

83-
class ClassWithSomeBadDocTests(object):
83+
class ClassWithSomeBadDocTests:
8484
def this_test_works():
8585
"""
8686
This test should be executed by --doctest-plus and should pass.
@@ -98,7 +98,7 @@ def this_test_fails():
9898
"""
9999

100100

101-
class ClassWithAllBadDocTests(object):
101+
class ClassWithAllBadDocTests:
102102
def this_test_fails(self):
103103
"""
104104
This test will cause a failure if __doctest_skip__ is not working.

tests/test_doctestplus.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def test_normalize_with_ellipsis(self):
314314
c = OutputChecker()
315315
got = []
316316
for char in ['A', 'B', 'C', 'D', 'E']:
317-
got.append('%s %s' % (char, float(ord(char))))
317+
got.append(f'{char} {float(ord(char))}')
318318
got = '\n'.join(got)
319319

320320
want = "A 65.0\nB 66.0\n...G 70.0"
@@ -1142,7 +1142,7 @@ def f():
11421142

11431143

11441144
@pytest.mark.xfail(
1145-
python_version() in ('3.11.9', '3.11.10', '3.12.3'),
1145+
python_version() in ('3.11.9', '3.11.10', '3.11.11', '3.12.3'),
11461146
reason='broken by https://github.com/python/cpython/pull/115440')
11471147
def test_ufunc(testdir):
11481148
pytest.importorskip('numpy')

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
envlist =
3-
py{38,39,310,311,312,313}-test
3+
py{39,310,311,312,313}-test
44
codestyle
55
requires =
66
setuptools >= 30.3.0

0 commit comments

Comments
 (0)