88
99jobs :
1010 build :
11-
11+ env :
12+ DEFAULT_PYTHON : 3.12
1213 runs-on : ubuntu-latest
1314 strategy :
1415 matrix :
15- python-version : ["3.8 ", "3.9 ", "3.10 ", "3.11 ", "3.12 "]
16+ python-version : ["3.9 ", "3.10 ", "3.11 ", "3.12 ", "3.13 "]
1617 architecture : ["x64"]
1718 steps :
1819 - uses : actions/checkout@v2
@@ -21,59 +22,36 @@ jobs:
2122 with :
2223 python-version : ${{ matrix.python-version }}
2324 architecture : ${{ matrix.architecture }}
24- - name : Cache pip 3.8
25- if : matrix.python-version == 3.8
26- uses : actions/cache@v4
27- with :
28- # This path is specific to Ubuntu
29- path : ~/.cache/pip
30- # Look to see if there is a cache hit for the corresponding requirements file
31- key : ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev3.8.txt') }}
32- restore-keys : |
33- ${{ runner.os }}-pip-
34- ${{ runner.os }}-
3525 - name : Cache pip
36- if : matrix.python-version != 3.8
3726 env :
3827 PYO3_USE_ABI3_FORWARD_COMPATIBILITY : " 1"
3928 uses : actions/cache@v4
4029 with :
41- # This path is specific to Ubuntu
42- path : ~/.cache/pip
43- # Look to see if there is a cache hit for the corresponding requirements file
44- key : ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }}
4530 restore-keys : |
46- ${{ runner.os }}-pip-
4731 ${{ runner.os }}-
4832 - name : Upgrade setuptools
4933 if : matrix.python-version >= 3.12
5034 run : |
5135 # workaround for 3.12, SEE: https://github.com/pypa/setuptools/issues/3661#issuecomment-1813845177
5236 pip install --upgrade setuptools
53- - name : Install dependencies
54- if : matrix.python-version > 3.9
55- run : pip install -r requirements-dev.txt
56- - name : Install dependencies
57- if : matrix.python-version <= 3.9
58- run : pip install -r requirements-dev3.8.txt
5937 - name : Lint with flake8
60- if : matrix.python-version == 3.12
38+ if : matrix.python-version == ${{ env.DEFAULT_PYTHON }}
6139 run : |
6240 # stop the build if there are Python syntax errors or undefined names
63- flake8 deepdiff --count --select=E9,F63,F7,F82 --show-source --statistics
41+ nox -e flake8 -- deepdiff --count --select=E9,F63,F7,F82 --show-source --statistics
6442 # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
65- flake8 deepdiff --count --exit-zero --max-complexity=26 --max-line-lengt =250 --statistics
43+ nox -e flake8 -- deepdiff --count --exit-zero --max-complexity=26 --max-line-length =250 --statistics
6644 - name : Test with pytest and get the coverage
67- if : matrix.python-version == 3.12
45+ if : matrix.python-version == ${{ env.DEFAULT_PYTHON }}
6846 run : |
69- pytest --benchmark-disable --cov-report=xml --cov=deepdiff tests/ --runslow
47+ nox -e pytest -s -- --benchmark-disable --cov-report=xml --cov=deepdiff tests/ --runslow
7048 - name : Test with pytest and no coverage report
71- if : matrix.python-version != 3.12
49+ if : matrix.python-version != ${{ env.DEFAULT_PYTHON }}
7250 run : |
73- pytest -- benchmark-disable
51+ nox -e pytest -s -- -- benchmark-disable tests/
7452 - name : Upload coverage to Codecov
7553 uses : codecov/codecov-action@v4
76- if : matrix.python-version == 3.12
54+ if : matrix.python-version == ${{ env.DEFAULT_PYTHON }}
7755 env :
7856 CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
7957 with :
0 commit comments