@@ -15,60 +15,29 @@ jobs:
1515 lint :
1616 name : Linting
1717 runs-on : ubuntu-latest
18- env :
19- # Configure pip to cache dependencies and do a user install
20- PIP_NO_CACHE_DIR : false
21- PIP_USER : 1
22-
23- # Hide the graphical elements from pipenv's output
24- PIPENV_HIDE_EMOJIS : 1
25- PIPENV_NOSPIN : 1
26-
27- # Make sure pipenv does not try reuse an environment it's running in
28- PIPENV_IGNORE_VIRTUALENVS : 1
29-
30- # Specify explicit paths for python dependencies and the pre-commit
31- # environment so we know which directories to cache
32- PYTHONUSERBASE : ${{ github.workspace }}/.cache/py-user-base
33- PRE_COMMIT_HOME : ${{ github.workspace }}/.cache/pre-commit-cache
3418 steps :
35- - name : Add custom PYTHONUSERBASE to PATH
36- run : echo '${{ env.PYTHONUSERBASE }}/bin/' >> $GITHUB_PATH
3719 - name : Checkout repo
38- uses : actions/checkout@v2
20+ uses : actions/checkout@v6
3921
40- - name : Set up Python
41- uses : actions /setup-python@v2
22+ - name : Install uv
23+ uses : astral-sh /setup-uv@v7
4224 with :
43- python-version : ' 3.9'
25+ enable-cache : true
26+ resolution-strategy : " lowest"
27+ cache-dependency-glob : " uv.lock"
28+ activate-environment : true
4429
45- - name : Python Dependency Caching
46- uses : actions/cache@v2
47- id : python_cache
30+ - name : " Set up Python"
31+ uses : actions/setup-python@v6
4832 with :
49- path : ${{ env.PYTHONUSERBASE }}
50- key : " python-0-${{ runner.os }}-${{ env.PYTHONUSERBASE }}-\
51- ${{ steps.python.outputs.python-version }}-\
52- ${{ hashFiles('./Pipfile', './Pipfile.lock') }}"
33+ python-version-file : " pyproject.toml"
5334
54- # Install deps, skipping if we hit a cache
55- - name : Install dependencies
56- if : steps.python_cache.outputs.cache-hit != 'true'
57- run : |
58- pip install pipenv
59- pipenv install --dev --deploy --system
60-
61- - name : Pre-commit Environment Caching
62- uses : actions/cache@v2
63- with :
64- path : ${{ env.PRE_COMMIT_HOME }}
65- key : " precommit-0-${{ runner.os }}-${{ env.PRE_COMMIT_HOME }}-\
66- ${{ steps.python.outputs.python-version }}-\
67- ${{ hashFiles('./.pre-commit-config.yaml') }}"
35+ - name : Install the project
36+ run : uv sync --all-groups
6837
6938 - name : Run pre-commit hooks
70- run : export PIP_USER=0; SKIP=flake8 pre-commit run --all-files
39+ run : SKIP=ruff prek run --all-files
7140
72- - name : Lint Flake8
73- run : |
74- flake8 .
41+ # Run `ruff` using github formatting to enable automatic inline annotations.
42+ - name : Run ruff
43+ run : " ruff check --output-format=github . "
0 commit comments