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-
41name : Python package
52
63on :
@@ -16,25 +13,21 @@ jobs:
1613 strategy :
1714 fail-fast : false
1815 matrix :
19- python-version : ["3.8 ", "3.9 ", "3.10", "3.11 "]
16+ python-version : ["3.11 ", "3.12 ", "3.13 "]
2017
2118 steps :
22- - uses : actions/checkout@main
23- - name : Set up Python ${{ matrix.python-version }}
24- uses : actions /setup-python@main
19+ - uses : actions/checkout@v4
20+ - name : Install uv
21+ uses : astral-sh /setup-uv@v4
2522 with :
26- python-version : ${{ matrix.python-version }}
23+ version : " latest"
24+ - name : Set up Python ${{ matrix.python-version }}
25+ run : uv python install ${{ matrix.python-version }}
2726 - name : Install dependencies
28- run : |
29- python -m pip install --upgrade pip
30- python -m pip install flake8 pytest
31- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
27+ run : uv sync --python ${{ matrix.python-version }}
3228 - name : Lint with flake8
3329 run : |
34- # stop the build if there are Python syntax errors or undefined names
35- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
36- # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
37- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
30+ uv run --with flake8 flake8 . --exclude=.venv --count --select=E9,F63,F7,F82 --show-source --statistics
31+ uv run --with flake8 flake8 . --exclude=.venv --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3832 - name : Test with pytest
39- run : |
40- pytest
33+ run : uv run pytest
0 commit comments