Skip to content

Commit c240a35

Browse files
Install the same uv version in docker as used by uv2nix (#1037)
* install the same uv version in docker as used by uv2nix * install `uv` in CI without nix * update and use `deps/uv_release` to store & query uv version --------- Co-authored-by: Palina <polina.tolmach@gmail.com>
1 parent 20ece95 commit c240a35

5 files changed

Lines changed: 33 additions & 28 deletions

File tree

.github/actions/with-docker/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ runs:
5555
GROUP=${USER}
5656
Z3_VERSION=$(cat deps/z3)
5757
K_VERSION=$(cat deps/k_release)
58+
UV_VERSION=$(cat deps/uv_release)
5859
USER_ID=1000
5960
GROUP_ID=${USER_ID}
6061
@@ -67,7 +68,8 @@ runs:
6768
--build-arg BASE_DISTRO=${BASE_DISTRO} \
6869
--build-arg K_VERSION=${K_VERSION} \
6970
--build-arg Z3_VERSION=${Z3_VERSION} \
70-
--build-arg LLVM_VERSION=${LLVM_VERSION}
71+
--build-arg LLVM_VERSION=${LLVM_VERSION} \
72+
--build-arg UV_VERSION=${UV_VERSION}
7173
7274
docker run \
7375
--name ${CONTAINER_NAME} \

.github/workflows/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ WORKDIR /home/${USER}/workspace
5050

5151
ENV PATH=/home/${USER}/.cargo/bin:/home/${USER}/.local/bin:/usr/local/bin/:${PATH}
5252

53-
RUN curl -LsSf https://astral.sh/uv/0.7.2/install.sh | sh && uv --version
53+
ARG UV_VERSION
54+
RUN curl -LsSf https://astral.sh/uv/$UV_VERSION/install.sh | sh && uv --version
5455

5556
RUN cargo install svm-rs --version 0.3.0 --locked \
5657
&& svm install 0.8.13 \

.github/workflows/test-pr.yml

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,14 @@ jobs:
1515
steps:
1616
- name: 'Check out code'
1717
uses: actions/checkout@v4
18-
- name: 'Install Nix'
19-
uses: cachix/install-nix-action@v31.2.0
20-
with:
21-
install_url: https://releases.nixos.org/nix/nix-2.24.12/install
22-
extra_nix_config: |
23-
substituters = http://cache.nixos.org https://cache.iog.io
24-
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
25-
# note: we install uv from the nix flake in order to match the uv version that is used by uv2nix
26-
- name: 'Install uv'
18+
- name: 'Get uv release'
19+
id: uv_release
2720
run: |
28-
nix profile install .#uv
29-
uv --version
21+
echo uv_version=$(cat deps/uv_release) >> "${GITHUB_OUTPUT}"
22+
- name: 'Install uv'
23+
uses: astral-sh/setup-uv@v6
24+
with:
25+
version: ${{ steps.uv_release.outputs.uv_version }}
3026
- name: 'Run code quality checks'
3127
run: make check
3228
- name: 'Run pyupgrade'
@@ -39,18 +35,14 @@ jobs:
3935
steps:
4036
- name: 'Check out code'
4137
uses: actions/checkout@v4
42-
- name: 'Install Nix'
43-
uses: cachix/install-nix-action@v31.2.0
44-
with:
45-
install_url: https://releases.nixos.org/nix/nix-2.24.12/install
46-
extra_nix_config: |
47-
substituters = http://cache.nixos.org https://cache.iog.io
48-
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
49-
# note: we install uv from the nix flake in order to match the uv version that is used by uv2nix
50-
- name: 'Install uv'
38+
- name: 'Get uv release'
39+
id: uv_release
5140
run: |
52-
nix profile install .#uv
53-
uv --version
41+
echo uv_version=$(cat deps/uv_release) >> "${GITHUB_OUTPUT}"
42+
- name: 'Install uv'
43+
uses: astral-sh/setup-uv@v6
44+
with:
45+
version: ${{ steps.uv_release.outputs.uv_version }}
5446
- name: 'Run unit tests'
5547
run: make cov-unit
5648

.github/workflows/update-version.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,20 @@ jobs:
4040
with:
4141
name: k-framework
4242
authToken: ${{ secrets.CACHIX_PUBLIC_TOKEN }}
43-
# note: we install uv from the nix flake in order to match the uv version that is used by uv2nix
44-
- name: 'Install uv'
43+
# note: we install the same version of `uv` as used by `uv2nix` in order to match the nix derivation
44+
- name: 'Update uv release tag'
45+
id: uv_release
4546
run: |
46-
nix profile install .#uv
47-
uv --version
47+
UV2NIX_VERSION=$(cat deps/uv2nix)
48+
UV_VERSION=$(curl -s https://raw.githubusercontent.com/pyproject-nix/uv2nix/$(cat deps/uv2nix)/pkgs/uv-bin/srcs.json | jq -r .version)
49+
[[ "$UV_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]
50+
echo $UV_VERSION > deps/uv_release
51+
git add deps/uv_release && git commit -m "Sync uv version: uv ${UV_VERSION}" || true
52+
echo uv_version=$UV_VERSION >> "${GITHUB_OUTPUT}"
53+
- name: 'Install uv'
54+
uses: astral-sh/setup-uv@v6
55+
with:
56+
version: ${{ steps.uv_release.outputs.uv_version }}
4857
- name: 'Update kevm-pyk release tag'
4958
run: |
5059
KEVM_VERSION="$(cat deps/kevm_release)"

deps/uv_release

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.7.2

0 commit comments

Comments
 (0)