Skip to content

Commit d84713d

Browse files
committed
ci: use uv to install packages
- use uv instead of pip for better peformance - drop cache as uv cache is way bigger than pip - install setuptools only when invoking setup.py manually
1 parent 451b406 commit d84713d

File tree

13 files changed

+56
-74
lines changed

13 files changed

+56
-74
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ jobs:
3535
uses: actions/setup-python@v5
3636
with:
3737
python-version: '3.11'
38-
cache: pip
3938
- name: Used versions
4039
run: ./ci/print-versions
41-
- name: Install pip dependencies
40+
- name: Install Python dependencies
4241
run: ./ci/pip-install
4342

4443
- name: Initialize CodeQL

.github/workflows/docs.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ jobs:
2626
uses: actions/setup-python@v5
2727
with:
2828
python-version: '3.11'
29-
cache: pip
30-
cache-dependency-path: docs/requirements.txt
3129
- name: Install apt dependencies
3230
run: |
3331
sudo apt update
3432
sudo apt install -y graphviz
35-
- name: Install pip dependencies
36-
run: pip install -r docs/requirements.txt
33+
- name: Install Python dependencies
34+
run: |
35+
pip install uv
36+
uv pip install --system -r docs/requirements.txt
3737
- name: Sphinx build
3838
run: |
3939
echo "::add-matcher::.github/matchers/sphinx.json"
@@ -54,10 +54,11 @@ jobs:
5454
uses: actions/setup-python@v5
5555
with:
5656
python-version: '3.11'
57-
cache: pip
5857
cache-dependency-path: docs/requirements.txt
59-
- name: Install pip dependencies
60-
run: pip install -r docs/requirements.txt
58+
- name: Install Python dependencies
59+
run: |
60+
pip install uv
61+
uv pip install --system -r docs/requirements.txt
6162
- name: Sphinx linkcheck
6263
run: |
6364
./ci/run-docs linkcheck

.github/workflows/licenses-update.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,16 @@ jobs:
2828
submodules: true
2929
- uses: actions/cache@v4
3030
with:
31-
path: |
32-
~/.cache/pip
33-
~/.cache/pre-commit
31+
path: ~/.cache/pre-commit
3432
key: ${{ runner.os }}-pre-commit-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('.pre-commit-config.yaml') }}
3533
- name: Set up Python
3634
uses: actions/setup-python@v5
3735
with:
3836
python-version: '3.11'
3937
- name: Install dependencies
4038
run: |
41-
python -m pip install $(sed -n 's/.*"\(pip==\([^"]*\)\)".*/\1/p' pyproject.toml)
42-
pip install $(sed -n 's/.*"\(wheel==\([^"]*\)\)".*/\1/p' pyproject.toml)
43-
pip install $(sed -n 's/.*"\(pre-commit==\([^"]*\)\)".*/\1/p' pyproject.toml)
39+
python -m pip install $(sed -n 's/.*"\(uv==\([^"]*\)\)".*/\1/p' pyproject.toml)
40+
uv pip install --system $(sed -n 's/.*"\(pre-commit==\([^"]*\)\)".*/\1/p' pyproject.toml)
4441
- run: ./scripts/generate-license-data
4542
- name: Update renovate branch
4643
if: github.ref != 'refs/heads/main'

.github/workflows/migrations.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ jobs:
4444
uses: actions/setup-python@v5
4545
with:
4646
python-version: 3.11
47-
cache: pip
48-
- name: Install pip dependencies
47+
- name: Install Python dependencies
4948
run: ./ci/pip-install migrations
5049
- name: Check missing migrations
5150
run: ./ci/run-checkmigrate

.github/workflows/mypy.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828
uses: actions/setup-python@v5
2929
with:
3030
python-version: '3.11'
31-
cache: pip
3231
- name: Install dependencies
3332
run: ./ci/pip-install mypy
3433

.github/workflows/pre-commit.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,20 @@ jobs:
2424
- uses: actions/checkout@v4
2525
- uses: actions/cache@v4
2626
with:
27-
path: |
28-
~/.cache/pip
29-
~/.cache/pre-commit
30-
key: ${{ runner.os }}-pre-commit-${{ hashFiles('**/requirements*.txt') }}-${{ hashFiles('.pre-commit-config.yaml') }}-${{ hashFiles('pyproject.toml') }}
27+
path: ~/.cache/pre-commit
28+
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
3129
- name: Setup Python
3230
uses: actions/setup-python@v5
3331
with:
3432
python-version: '3.11'
35-
- name: Update pip
36-
run: python -m pip install --upgrade pip wheel
33+
- name: Install uv
34+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
3735
- name: Install dependencies
3836
run: |
3937
if [ -f requirements-lint.txt ] ; then
40-
pip install -r requirements-lint.txt
38+
uv pip install --system -r requirements-lint.txt
4139
else
42-
pip install $(sed -n 's/.*"\(pre-commit==\([^"]*\)\)".*/\1/p' pyproject.toml)
40+
uv pip install --system $(sed -n 's/.*"\(pre-commit==\([^"]*\)\)".*/\1/p' pyproject.toml)
4341
fi
4442
- name: pre-commit
4543
run: pre-commit run --all

.github/workflows/pylint.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,10 @@ jobs:
2626
uses: actions/setup-python@v5
2727
with:
2828
python-version: '3.11'
29-
cache: pip
3029
- name: Install dependencies
3130
run: |
32-
python -m pip install $(sed -n 's/.*"\(pip==\([^"]*\)\)".*/\1/p' pyproject.toml)
33-
pip install $(sed -n 's/.*"\(wheel==\([^"]*\)\)".*/\1/p' pyproject.toml)
34-
pip install $(sed -n 's/.*"\(pylint==\([^"]*\)\)".*/\1/p' pyproject.toml)
31+
python -m pip install $(sed -n 's/.*"\(uv==\([^"]*\)\)".*/\1/p' pyproject.toml)
32+
uv pip install --system $(sed -n 's/.*"\(pylint==\([^"]*\)\)".*/\1/p' pyproject.toml)
3533
- name: Add pylint annotator
3634
uses: pr-annotators/[email protected]
3735

.github/workflows/schema-update.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,11 @@ jobs:
2828
uses: actions/setup-python@v5
2929
with:
3030
python-version: '3.11'
31-
- name: Install pip dependencies
31+
- name: Install Python dependencies
3232
run: |
33-
python -m pip install $(sed -n 's/.*"\(pip==\([^"]*\)\)".*/\1/p' pyproject.toml)
34-
pip install $(sed -n 's/.*"\(wheel==\([^"]*\)\)".*/\1/p' pyproject.toml)
35-
pip install $(sed -n 's/.*"\(weblate-schemas==\([^"]*\)\)".*/\1/p' pyproject.toml)
36-
pip install $(sed -n 's/.*"\(pre-commit==\([^"]*\)\)".*/\1/p' pyproject.toml)
33+
python -m pip install $(sed -n 's/.*"\(uv==\([^"]*\)\)".*/\1/p' pyproject.toml)
34+
uv pip install --system $(sed -n 's/.*"\(weblate-schemas==\([^"]*\)\)".*/\1/p' pyproject.toml)
35+
uv pip install --system $(sed -n 's/.*"\(pre-commit==\([^"]*\)\)".*/\1/p' pyproject.toml)
3736
- run: make -C docs update-schemas
3837
- run: pre-commit run --files $(git diff --name-only)
3938
continue-on-error: true

.github/workflows/setup.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ jobs:
3333
uses: actions/setup-python@v5
3434
with:
3535
python-version: '3.11'
36-
cache: pip
3736
- name: Used versions
3837
run: ./ci/print-versions
39-
- name: Install pip dependencies
38+
- name: Install Python dependencies
4039
run: ./ci/pip-install
40+
- name: Install setuptools
41+
run: uv pip install --system $(sed -n 's/.*"\(setuptools[<>=]=\([^"]*\)\)".*/\1/p' pyproject.toml)
4142
- name: Install Weblate
4243
run: coverage run ./setup.py install
4344
- name: Check difference
@@ -67,13 +68,12 @@ jobs:
6768
uses: actions/setup-python@v5
6869
with:
6970
python-version: '3.11'
70-
cache: pip
7171
- name: Used versions
7272
run: ./ci/print-versions
73-
- name: Install pip dependencies
73+
- name: Install Python dependencies
7474
run: ./ci/pip-install
7575
- name: Install Weblate
76-
run: pip install '.[all]'
76+
run: uv pip install --system '.[all]'
7777
- name: Check difference
7878
run: diff -ruNqp weblate $(python -c 'import weblate; import os; print(os.path.dirname(weblate.__file__))')
7979

@@ -92,13 +92,11 @@ jobs:
9292
uses: actions/setup-python@v5
9393
with:
9494
python-version: '3.11'
95-
cache: pip
96-
- name: Install pip dependencies
95+
- name: Install Python dependencies
9796
run: |
98-
python -m pip install $(sed -n 's/.*"\(pip==\([^"]*\)\)".*/\1/p' pyproject.toml)
99-
pip install $(sed -n 's/.*"\(wheel==\([^"]*\)\)".*/\1/p' pyproject.toml)
100-
pip install $(sed -n 's/.*"\(twine==\([^"]*\)\)".*/\1/p' pyproject.toml)
101-
pip install $(sed -n 's/.*"\(build==\([^"]*\)\)".*/\1/p' pyproject.toml)
97+
python -m pip install $(sed -n 's/.*"\(uv==\([^"]*\)\)".*/\1/p' pyproject.toml)
98+
uv pip install --system $(sed -n 's/.*"\(twine==\([^"]*\)\)".*/\1/p' pyproject.toml)
99+
uv pip install --system $(sed -n 's/.*"\(build==\([^"]*\)\)".*/\1/p' pyproject.toml)
102100
- name: build
103101
run: python -m build
104102
- name: Twine check
@@ -122,14 +120,14 @@ jobs:
122120
uses: actions/setup-python@v5
123121
with:
124122
python-version: '3.11'
125-
cache: pip
126-
cache-dependency-path: docs/requirements.txt
127123
- name: Install apt dependencies
128124
run: |
129125
sudo apt update
130126
sudo apt install -y graphviz pandoc
131-
- name: Install pip dependencies
132-
run: pip install -r docs/requirements.txt
127+
- name: Install Python dependencies
128+
run: |
129+
python -m pip install $(sed -n 's/.*"\(uv==\([^"]*\)\)".*/\1/p' pyproject.toml)
130+
uv pip install --system -r docs/requirements.txt
133131
- name: Sphinx build
134132
run: ./ci/run-docs
135133
- name: Convert release notes

.github/workflows/test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,9 @@ jobs:
6868
uses: actions/setup-python@v5
6969
with:
7070
python-version: ${{ matrix.python-version }}
71-
cache: pip
7271
- name: Used versions
7372
run: ./ci/print-versions
74-
- name: Install pip dependencies
73+
- name: Install Python dependencies
7574
run: ./ci/pip-install ${{ matrix.requirements }}
7675
- name: Prepare database
7776
run: ./ci/prepare-database

0 commit comments

Comments
 (0)