Skip to content

Commit 9dead77

Browse files
committed
Switch from venv+pip to uv
1 parent b9731ec commit 9dead77

File tree

1 file changed

+18
-39
lines changed

1 file changed

+18
-39
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -59,70 +59,49 @@ jobs:
5959
with:
6060
python-version: ${{ matrix.python }}
6161

62-
- name: Set venv path (NON Windows)
63-
if: matrix.os != 'windows-latest'
64-
run: |
65-
echo "VIRTUAL_ENV=${{ github.workspace }}/venv" >> $GITHUB_ENV
66-
echo ${{ github.workspace }}/venv/bin >> $GITHUB_PATH
67-
68-
- name: Set venv path (Windows)
69-
if: matrix.os == 'windows-latest'
70-
run: |
71-
echo "VIRTUAL_ENV=${{ github.workspace }}\\venv" >> $Env:GITHUB_ENV
72-
echo "${{ github.workspace }}\\venv\\Scripts" >> $Env:GITHUB_PATH
73-
74-
- name: Restore base Python virtual environment
75-
id: cache-venv
76-
uses: actions/[email protected]
62+
- name: Install uv
63+
uses: astral-sh/setup-uv@v6
7764
with:
78-
path: ${{ env.VIRTUAL_ENV }}
79-
key: >-
80-
${{ runner.os }}-${{ matrix.python }}-venv-${{
81-
hashFiles('pyproject.toml') }}
65+
python-version: ${{ matrix.python }}
66+
enable-cache: true
8267

83-
- name: Create venv (NEW CACHE)
84-
if: steps.cache-venv.outputs.cache-hit != 'true'
68+
- name: Create virtualenv and sync dependencies
8569
run: |
86-
python -m venv ${{ env.VIRTUAL_ENV }}
87-
python -m pip install --upgrade pip
88-
pip install -e ".[all]"
70+
uv sync --all-extras
8971
9072
- name: codespell
9173
if: matrix.run_doc == true
9274
run: |
93-
codespell
75+
uv run codespell
9476
95-
- name: dcoumentation
96-
if: matrix.run_doc == true
97-
run: |
98-
cd doc; ./build_html
77+
# - name: documentation
78+
# if: matrix.run_doc == true
79+
# run: cd doc && ./build_html
9980

10081
- name: pylint
10182
if: matrix.run_lint == true
10283
run: |
103-
pylint --recursive=y examples pymodbus test
84+
uv run pylint --recursive=y examples pymodbus test
10485
10586
- name: mypy
10687
if: matrix.run_lint == true
10788
run: |
108-
mypy pymodbus examples
89+
uv run mypy pymodbus examples
10990
11091
- name: ruff
11192
if: matrix.run_lint == true
11293
run: |
113-
ruff check .
94+
uv run ruff check .
11495
11596
- name: pytest
116-
if: ${{ (matrix.os != 'ubuntu-latest') || (matrix.python != '3.13') }}
117-
run: |
118-
env
119-
pytest
97+
if: ${{ (matrix.os != 'ubuntu-latest') || (matrix.python != '3.13.0') }}
98+
run: |
99+
uv run pytest
120100
121101
- name: pytest coverage
122-
if: ${{ (matrix.os == 'ubuntu-latest') && (matrix.python == '3.13') }}
102+
if: ${{ (matrix.os == 'ubuntu-latest') && (matrix.python == '3.13.0') }}
123103
run: |
124-
env
125-
pytest --cov
104+
uv run pytest --cov
126105
127106
analyze:
128107
name: Analyze Python

0 commit comments

Comments
 (0)