1- # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2- # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3-
4- name : Python package
1+ name : Test and lint
52
63on :
74 push :
118
129jobs :
1310 build :
14-
1511 runs-on : ubuntu-latest
1612 strategy :
1713 matrix :
18- python-version : [3.8, 3.9 , '3.10 ', '3.11 ']
14+ python-version : ['3.9', '3.10' , '3.11 ', '3.12', '3.13', '3.14 ']
1915
2016 steps :
21-
22- - uses : actions/checkout@v2
23-
24- - name : Set up Python ${{ matrix.python-version }}
25- uses : actions/setup-python@v2
26- with :
27- python-version : ${{ matrix.python-version }}
28-
29- - name : Install dependencies
30- run : |
31- python -m pip install --upgrade pip
32- pip install flake8 pytest
33- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
34-
35- - name : Lint with flake8
36- run : |
37- # stop the build if there are Python syntax errors or undefined names
38- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
39- # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
40- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
41-
42- - name : Test with pytest
43- run : |
44- pytest
17+ - uses : actions/checkout@v3
18+
19+ - name : Set up Python ${{ matrix.python-version }}
20+ uses : actions/setup-python@v3
21+ with :
22+ python-version : ${{ matrix.python-version }}
23+
24+ - name : Install uv
25+ run : |
26+ curl -LsSf https://astral.sh/uv/install.sh | sh
27+ echo "$HOME/.cargo/bin" >> $GITHUB_PATH
28+
29+ - name : Cache virtual environment
30+ uses : actions/cache@v3
31+ with :
32+ path : .venv
33+ key : venv-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
34+ restore-keys : |
35+ venv-${{ matrix.python-version }}-
36+
37+ - name : Set up uv venv and install dependencies
38+ run : |
39+ uv venv
40+ source .venv/bin/activate
41+ uv pip install ruff pytest pytest-cov pytest-codspeed
42+ uv pip install -e .
43+
44+ - name : Lint with ruff
45+ run : |
46+ source .venv/bin/activate
47+ ruff check dotmotif
48+
49+ - name : Test with pytest
50+ run : |
51+ source .venv/bin/activate
52+ pytest
0 commit comments