Skip to content

Commit 5bc685d

Browse files
committed
treewide: Use uv to handle python dependencies and venv
1 parent 701b483 commit 5bc685d

10 files changed

Lines changed: 1041 additions & 73 deletions

File tree

.github/authors-cfg.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ exclude-ext:
2727
- svg
2828
- txt
2929
- json
30+
- toml
3031
- md
3132
- lock
3233
- local

.github/workflows/analyze.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@ jobs:
2121
name: Checkout
2222
uses: actions/checkout@v4
2323
-
24-
name: Install Python
25-
uses: actions/setup-python@v5
26-
with:
27-
python-version: 3.11
28-
cache: 'pip'
24+
name: Install uv
25+
uses: astral-sh/setup-uv@v5
2926
-
30-
name: Python Requirements
31-
run: pip install -r requirements.txt
27+
name: Install Python dependencies
28+
run: |
29+
uv sync --locked
30+
echo "$PWD/.venv/bin" >> $GITHUB_PATH
3231
-
3332
name: List contributors
3433
run: scripts/list-contributors | tee contributions.txt
@@ -48,14 +47,13 @@ jobs:
4847
name: Checkout
4948
uses: actions/checkout@v4
5049
-
51-
name: Install Python
52-
uses: actions/setup-python@v5
53-
with:
54-
python-version: 3.11
55-
cache: 'pip'
50+
name: Install uv
51+
uses: astral-sh/setup-uv@v5
5652
-
57-
name: Python Requirements
58-
run: pip install -r requirements.txt
53+
name: Install Python dependencies
54+
run: |
55+
uv sync --locked
56+
echo "$PWD/.venv/bin" >> $GITHUB_PATH
5957
-
6058
name: List todos
6159
run: scripts/list-todos | tee open_todos.txt

.github/workflows/build.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,8 @@ jobs:
2525
name: Checkout
2626
uses: actions/checkout@v4
2727
-
28-
name: Install Python
29-
uses: actions/setup-python@v5
30-
with:
31-
python-version: 3.11
32-
cache: pip
33-
-
34-
name: Install Python requirements
35-
run: pip install -r requirements.txt
28+
name: Install uv
29+
uses: astral-sh/setup-uv@v5
3630
-
3731
name: Setup Graphviz
3832
uses: ts-graphviz/setup-graphviz@v2
@@ -58,13 +52,13 @@ jobs:
5852
echo "PATH=.:$PATH" >> ${GITHUB_ENV}
5953
-
6054
name: Check clean
61-
run: make idma_clean_all
55+
run: uv run --locked make idma_clean_all
6256
-
6357
name: Check whether clean
6458
run: git status && test -z "$(git status --porcelain --ignore-submodules)"
6559
-
6660
name: Build target
67-
run: make -j9 idma_${{ matrix.target }}_all
61+
run: uv run --locked make -j9 idma_${{ matrix.target }}_all
6862
-
6963
name: Check whether stale
7064
run: git status && test -z "$(git status --porcelain --ignore-submodules)"

.github/workflows/deploy.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,8 @@ jobs:
2222
with:
2323
fetch-depth: 0
2424
-
25-
name: Install Python
26-
uses: actions/setup-python@v5
27-
with:
28-
python-version: 3.11
29-
cache: 'pip'
30-
-
31-
name: Python Requirements
32-
run: pip install -r requirements.txt
25+
name: Install uv
26+
uses: astral-sh/setup-uv@v5
3327
-
3428
name: Install Bender
3529
uses: pulp-platform/pulp-actions/bender-install@v2
@@ -45,11 +39,11 @@ jobs:
4539
echo "PATH=.:$PATH" >> ${GITHUB_ENV}
4640
-
4741
name: Build hardware
48-
run: make -B idma_hw_all
42+
run: uv run --locked make -B idma_hw_all
4943
-
5044
name: Deploy generated files
5145
run: |
5246
git config user.email "github-ci@iis.ee.ethz.ch"
5347
git config user.name "github-ci"
5448
git fetch --all
55-
python3 util/deploy.py
49+
uv run --locked util/deploy.py

.github/workflows/docs.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,10 @@ jobs:
2424
name: Checkout
2525
uses: actions/checkout@v4
2626
-
27-
name: Install Python
28-
uses: actions/setup-python@v5
27+
name: Install uv
28+
uses: astral-sh/setup-uv@v6
2929
with:
30-
python-version: 3.11
31-
cache: pip
32-
-
33-
name: Install Python requirements
34-
run: pip install -r requirements.txt
30+
python-version: "3.11"
3531
-
3632
name: Setup Graphviz
3733
uses: ts-graphviz/setup-graphviz@v2
@@ -57,7 +53,7 @@ jobs:
5753
echo "PATH=.:$PATH" >> ${GITHUB_ENV}
5854
-
5955
name: Build Doc
60-
run: make idma_doc_all
56+
run: uv run --locked make idma_doc_all
6157
-
6258
name: Create publish docs
6359
uses: actions/upload-pages-artifact@v3

.github/workflows/lint.yml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,10 @@ jobs:
119119
with:
120120
ref: ${{ github.event.pull_request.head.sha }}
121121
-
122-
uses: actions/setup-python@v5
123-
with:
124-
python-version: 3.11
125-
cache: 'pip'
126-
-
127-
name: Python Requirements
128-
run: python3 -m pip install -r requirements.txt
122+
uses: astral-sh/setup-uv@v5
129123
-
130124
name: Lint commits
131-
run: python3 util/lint-commits.py HEAD
125+
run: uv run --locked util/lint-commits.py HEAD
132126

133127
lint-author:
134128
runs-on: ubuntu-latest
@@ -137,14 +131,8 @@ jobs:
137131
name: Checkout
138132
uses: actions/checkout@v4
139133
-
140-
name: Install Python
141-
uses: actions/setup-python@v5
142-
with:
143-
python-version: 3.11
144-
cache: 'pip'
145-
-
146-
name: Python Requirements
147-
run: pip install -r requirements.txt
134+
name: Install uv
135+
uses: astral-sh/setup-uv@v5
148136
-
149137
name: Lint authors
150-
run: python3 util/lint-authors.py .github/authors-cfg.yaml
138+
run: uv run --locked util/lint-authors.py .github/authors-cfg.yaml

idma.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ idma_spinx_doc_clean:
460460

461461
IDMA_NONFREE_REMOTE ?= git@iis-git.ee.ethz.ch:bslk/idma/idma-non-free.git
462462
IDMA_NONFREE_DIR ?= $(IDMA_ROOT)/nonfree
463-
IDMA_NONFREE_COMMIT ?= deploy
463+
IDMA_NONFREE_COMMIT ?= fischeti/uv # TODO(fischeti): Revert back when merged
464464

465465
idma_nonfree_init:
466466
git clone $(IDMA_NONFREE_REMOTE) $(IDMA_NONFREE_DIR)

pyproject.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright 2025 ETH Zurich and University of Bologna.
2+
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
# Authors:
6+
# - Tim Fischer <fischeti@iis.ee.ethz.ch>
7+
8+
[project]
9+
name = "idma"
10+
version = "0.1.0"
11+
requires-python = ">=3.11"
12+
dependencies = [
13+
"GitPython",
14+
"pre-commit",
15+
"hjson",
16+
"tabulate",
17+
"pyyaml",
18+
"mako",
19+
"sphinx",
20+
"sphinx-rtd-theme",
21+
"recommonmark",
22+
"sphinxcontrib-svg2pdfconverter",
23+
"pylint",
24+
"peakrdl>=1.5.0",
25+
"peakrdl-rawheader>=0.2.2",
26+
]

requirements.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)