Skip to content

Commit a0573c8

Browse files
committed
simplify tests pipeline
1 parent 436fbca commit a0573c8

File tree

4 files changed

+27
-58
lines changed

4 files changed

+27
-58
lines changed

.github/workflows/tests.yml

+15-14
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
runs-on: ${{ matrix.os }}
66
strategy:
77
matrix:
8-
os: ['ubuntu-20.04']
8+
os: ['ubuntu-24.04']
99
python-version:
1010
- '3.7'
1111
- '3.8'
@@ -15,17 +15,17 @@ jobs:
1515
- 'pypy-3.8'
1616
- 'pypy-3.9'
1717
- 'pypy-3.10'
18-
tox-env: ['essential']
18+
tests: ['essential']
1919
include:
2020
- os: macos-latest
2121
python-version: '3.12'
22-
tox-env: essential
22+
tests: essential
2323
- os: windows-latest
2424
python-version: '3.11'
25-
tox-env: essential
25+
tests: essential
2626
- os: ubuntu-latest
2727
python-version: '3.10'
28-
tox-env: extended
28+
tests: extended
2929
steps:
3030
- uses: actions/checkout@v4
3131

@@ -35,20 +35,21 @@ jobs:
3535
python-version: ${{ matrix.python-version }}
3636
cache: 'pip'
3737

38-
- name: Install dependencies
39-
run: |
40-
pip install --quiet --upgrade tox>=4.5.1
41-
4238
- name: Run essential tests
43-
if: ${{ matrix.tox-env != 'extended' }}
39+
if: ${{ matrix.tests != 'extended' }}
4440
run: |
45-
tox run -e ${{ matrix.tox-env }}
41+
pip install --quiet -e '.[cli,test]'
42+
pytest
4643
47-
- name: Run linters and coverage
48-
if: ${{ matrix.tox-env == 'extended' }}
44+
- name: Run extra linters and report coverage
45+
if: ${{ matrix.tests == 'extended' }}
4946
env:
5047
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
PYTHONHASHSEED: '1'
5149
run: |
50+
pip install --quiet -e '.[cli,test,lint]'
51+
pytest --doctest-modules
52+
python -m doctest HOWTO.md README.md
53+
darglint --docstring-style google --strictness short nested_diff
5254
pip install --quiet --upgrade coveralls
53-
tox run -e ${{ matrix.tox-env }}
5455
coveralls --service=github

pyproject.toml

+10-10
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ test = [
5656
'pytest',
5757
'pytest-cov',
5858
'pytest-ruff',
59-
'ruff==0.8.0',
59+
'ruff==0.8.2',
6060
]
6161

6262
[project.scripts]
@@ -68,15 +68,15 @@ Homepage = 'https://github.com/mr-mixas/Nested-Diff.py'
6868
Repository = 'https://github.com/mr-mixas/Nested-Diff.py.git'
6969

7070
[tool.pytest.ini_options]
71-
addopts = """
72-
--cov=nested_diff \
73-
--cov-fail-under=99 \
74-
--cov-report term-missing \
75-
--no-cov-on-fail \
76-
--ruff \
77-
--ruff-format \
78-
--verbosity=2 \
79-
"""
71+
addopts = [
72+
'--cov=nested_diff',
73+
'--cov-fail-under=99',
74+
'--cov-report=term-missing',
75+
'--no-cov-on-fail',
76+
'--ruff',
77+
'--ruff-format',
78+
'--verbosity=2',
79+
]
8080
doctest_optionflags = 'NORMALIZE_WHITESPACE'
8181
testpaths = 'nested_diff tests'
8282

tests/data/gen_standard.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def format_test(**kwargs):
1515
}},""".format(**kwargs)
1616

1717

18-
def generate_tests(source_dir=sys.argv[1]):
18+
def generate_tests(source_dir):
1919
tests = []
2020
for file_name in sorted(os.listdir(source_dir)):
2121
with open(os.path.join(source_dir, file_name)) as f:
@@ -66,4 +66,4 @@ def get_tests():
6666

6767

6868
if __name__ == '__main__':
69-
generate_tests()
69+
generate_tests(sys.argv[1])

tox.ini

-32
This file was deleted.

0 commit comments

Comments
 (0)