Skip to content

Commit 25ec34b

Browse files
authored
Merge pull request #10 from WiredNerd/py313
Add support for 3.12, remove 3.8
2 parents 5e5e9fa + a2a0417 commit 25ec34b

File tree

15 files changed

+72
-184
lines changed

15 files changed

+72
-184
lines changed

.github/workflows/python-mutation-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ jobs:
1010
runs-on: [ubuntu-latest]
1111
steps:
1212
- uses: actions/checkout@v4
13-
- uses: actions/setup-python@v4
13+
- uses: actions/setup-python@v5
1414
with:
15-
python-version: '3.12'
15+
python-version: '3.13'
1616
- name: Install Dependencies and Tools
1717
run: |
1818
python3 -m pip install --upgrade pip
@@ -24,7 +24,7 @@ jobs:
2424
- run: poodle --html mutation_reports
2525
- name: Upload Report HTML
2626
if: ${{ always() }}
27-
uses: actions/upload-artifact@v3
27+
uses: actions/upload-artifact@v4
2828
with:
2929
name: Mutation testing report HTML
3030
path: mutation_reports

.github/workflows/python-publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ jobs:
2525
permissions:
2626
id-token: write
2727
steps:
28-
- uses: actions/checkout@v3
28+
- uses: actions/checkout@v4
2929
- name: Set up Python
30-
uses: actions/setup-python@v3
30+
uses: actions/setup-python@v5
3131
with:
32-
python-version: '3.12'
32+
python-version: '3.13'
3333
- name: Install dependencies
3434
run: |
3535
python -m pip install --upgrade pip

.github/workflows/python-test-matrix.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
os: [windows-latest, ubuntu-latest, macos-latest]
25-
py: ['3.8','3.9','3.10','3.11','3.12']
25+
py: ['3.9','3.10','3.11','3.12','3.13']
2626
steps:
2727
- uses: actions/checkout@v4
28-
- uses: actions/setup-python@v4
28+
- uses: actions/setup-python@v5
2929
with:
3030
python-version: ${{ matrix.py }}
3131
- name: Install Dependencies and Tools

.github/workflows/python-test-scan.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- uses: actions/checkout@v4
23-
- uses: actions/setup-python@v4
23+
- uses: actions/setup-python@v5
2424
with:
25-
python-version: '3.12'
25+
python-version: '3.13'
2626
- name: Install Dependencies and Tools
2727
run: |
2828
python3 -m pip install --upgrade pip
@@ -32,13 +32,13 @@ jobs:
3232
- run: pytest --cov=src --cov-report=json:code-coverage.json
3333
- name: artifact-html-report
3434
if: ${{ always() }}
35-
uses: actions/upload-artifact@v3
35+
uses: actions/upload-artifact@v4
3636
with:
3737
name: Coverage Report HTML
3838
path: cov-html
3939
- name: artifact-json-report
4040
if: ${{ always() }}
41-
uses: actions/upload-artifact@v3
41+
uses: actions/upload-artifact@v4
4242
with:
4343
name: Coverage Report JSON
4444
path: code-coverage.json
@@ -47,9 +47,9 @@ jobs:
4747
runs-on: [ubuntu-latest]
4848
steps:
4949
- uses: actions/checkout@v4
50-
- uses: actions/setup-python@v4
50+
- uses: actions/setup-python@v5
5151
with:
52-
python-version: '3.12'
52+
python-version: '3.13'
5353
- name: Install Dependencies and Tools
5454
run: |
5555
python3 -m pip install --upgrade pip
@@ -63,9 +63,9 @@ jobs:
6363
runs-on: [ubuntu-latest]
6464
steps:
6565
- uses: actions/checkout@v4
66-
- uses: actions/setup-python@v4
66+
- uses: actions/setup-python@v5
6767
with:
68-
python-version: '3.12'
68+
python-version: '3.13'
6969
- name: Install Dependencies and Tools
7070
run: |
7171
python3 -m pip install --upgrade pip
@@ -89,16 +89,14 @@ jobs:
8989
runs-on: [ubuntu-latest]
9090
steps:
9191
- uses: actions/checkout@v4
92-
- uses: actions/setup-python@v4
92+
- uses: actions/setup-python@v5
9393
with:
94-
python-version: '3.12'
94+
python-version: '3.13'
9595
- name: Install Dependencies and Tools
9696
run: |
9797
python3 -m pip install --upgrade pip
9898
pip install -r req/requirements.txt --upgrade
9999
pip install -r req/mypy.txt --upgrade
100-
- run: mypy --python-version 3.8
101-
if: ${{ always() }}
102100
- run: mypy --python-version 3.9
103101
if: ${{ always() }}
104102
- run: mypy --python-version 3.10
@@ -107,6 +105,8 @@ jobs:
107105
if: ${{ always() }}
108106
- run: mypy --python-version 3.12
109107
if: ${{ always() }}
108+
- run: mypy --python-version 3.13
109+
if: ${{ always() }}
110110
ruff:
111111
name: Linter Checks with Ruff
112112
runs-on: [ubuntu-latest]
@@ -116,7 +116,7 @@ jobs:
116116
uses: chartboost/ruff-action@v1
117117
with:
118118
src: src
119-
args: check --show-source
119+
args: check --show-files
120120
- name: Ruff src diff
121121
uses: chartboost/ruff-action@v1
122122
if: ${{ always() }}
@@ -128,7 +128,7 @@ jobs:
128128
if: ${{ always() }}
129129
with:
130130
src: test
131-
args: check --show-source
131+
args: check --show-files
132132
- name: Ruff test diff
133133
uses: chartboost/ruff-action@v1
134134
if: ${{ always() }}

.github/workflows/update-coverage.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v4
17-
- uses: actions/setup-python@v4
17+
- uses: actions/setup-python@v5
1818
with:
19-
python-version: '3.12'
19+
python-version: '3.13'
2020
- name: Install Dependencies and Tools
2121
run: |
2222
python3 -m pip install --upgrade pip
@@ -35,15 +35,15 @@ jobs:
3535
message: ':robot: Update Coverage Report'
3636
- name: artifact-html-report
3737
if: ${{ always() }}
38-
uses: actions/upload-artifact@v3
38+
uses: actions/upload-artifact@v4
3939
with:
4040
name: Coverage Report
4141
path: cov-html
4242
- name: Poodle
4343
run: poodle --json mutation-testing-report.json --html html-report
4444
- name: Upload Report HTML
4545
if: ${{ always() }}
46-
uses: actions/upload-artifact@v3
46+
uses: actions/upload-artifact@v4
4747
with:
4848
name: Mutation testing report HTML
4949
path: html-report

mutmut.ipynb

Lines changed: 0 additions & 90 deletions
This file was deleted.

mutmut_config.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

pyproject.toml

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ command_line = "pytest -x --assert=plain -o pythonpath='{PYTHONPATH}' --sort-mod
6464

6565
[tool.black]
6666
line-length = 120
67-
target-version = ['py38', 'py39', 'py310', 'py311']
67+
target-version = ['py39', 'py310', 'py311', 'py312', 'py313']
6868
skip-string-normalization = true
6969
color = true
7070

@@ -76,19 +76,8 @@ files = "src"
7676
mypy_path = "src"
7777

7878
[tool.ruff]
79-
target-version = "py38"
80-
show-source = true
81-
select = ["ALL"]
82-
ignore = [
83-
"ANN101", # Missing type annotation for self in method
84-
"COM812", # missing-trailing-comma
85-
"D203", # 1 blank line required before class docstring
86-
"D213", # multi-line-summary-second-line
87-
"EM101", # Exception must not use a string literal, assign to variable first
88-
"ISC001", # single-line-implicit-string-concatenation
89-
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
90-
"TRY003", # Avoid specifying long messages outside the exception class
91-
]
79+
target-version = "py39"
80+
output-format = "full"
9281
line-length = 120
9382
exclude = [
9483
".eggs",
@@ -104,10 +93,25 @@ exclude = [
10493
"venv",
10594
]
10695

96+
[tool.ruff.lint]
97+
select = ["ALL"]
98+
ignore = [
99+
"COM812", # missing-trailing-comma
100+
"D203", # 1 blank line required before class docstring
101+
"D213", # multi-line-summary-second-line
102+
"EM101", # Exception must not use a string literal, assign to variable first
103+
"ISC001", # single-line-implicit-string-concatenation
104+
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
105+
"TRY003", # Avoid specifying long messages outside the exception class
106+
]
107+
108+
[tool.ruff.lint.flake8-pytest-style]
109+
fixture-parentheses = true
110+
107111
[tool.ruff.lint.isort]
108112
known-first-party = ["pytest_sort"]
109113

110-
[tool.ruff.per-file-ignores]
114+
[tool.ruff.lint.per-file-ignores]
111115
"src/pytest_sort/core.py" = [
112116
"ARG005", # Unused lambda argument
113117
"T201", # print found

req/tools.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ isort
44

55
-r pytest.txt
66
-r mypy.txt
7-
-r build.txt
7+
-r build.txt
8+
-r poodle.txt

src/pytest_sort/core.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import hashlib
66
import random
7-
import sys
87
from functools import partial
98
from typing import TYPE_CHECKING, Any, Callable
109

@@ -15,9 +14,7 @@
1514
from pytest_sort.database import get_all_totals, get_stats
1615
from pytest_sort.diffcov import get_diff_test_scores, get_mut_test_scores
1716

18-
md5: Callable = hashlib.md5
19-
if sys.version_info >= (3, 9):
20-
md5: Callable = partial(hashlib.md5, usedforsecurity=False) # type: ignore[no-redef]
17+
md5: Callable = partial(hashlib.md5, usedforsecurity=False) # type: ignore[no-redef]
2118

2219

2320
if TYPE_CHECKING:
@@ -254,7 +251,7 @@ def print_recorded_times_report(terminal_reporter: TerminalReporter) -> None:
254251

255252
print(
256253
f"\n*** {'pytest-sort maximum recorded times'.ljust(node_id_width)}"
257-
f"{'Nanoseconds'.center(stat_width*4 - 4)} ***",
254+
f"{'Nanoseconds'.center(stat_width * 4 - 4)} ***",
258255
)
259256
print(
260257
f"{'Test Case'.ljust(node_id_width)} {'setup'.rjust(stat_width)} "

0 commit comments

Comments
 (0)