Skip to content

Install the same uv version in docker as used by uv2nix #1037

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/actions/with-docker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ runs:
GROUP=${USER}
Z3_VERSION=$(cat deps/z3)
K_VERSION=$(cat deps/k_release)
UV_VERSION=$(cat deps/uv_release)
USER_ID=1000
GROUP_ID=${USER_ID}

Expand All @@ -67,7 +68,8 @@ runs:
--build-arg BASE_DISTRO=${BASE_DISTRO} \
--build-arg K_VERSION=${K_VERSION} \
--build-arg Z3_VERSION=${Z3_VERSION} \
--build-arg LLVM_VERSION=${LLVM_VERSION}
--build-arg LLVM_VERSION=${LLVM_VERSION} \
--build-arg UV_VERSION=${UV_VERSION}

docker run \
--name ${CONTAINER_NAME} \
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ WORKDIR /home/${USER}/workspace

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

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

RUN cargo install svm-rs --version 0.3.0 --locked \
&& svm install 0.8.13 \
Expand Down
36 changes: 14 additions & 22 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,14 @@ jobs:
steps:
- name: 'Check out code'
uses: actions/checkout@v4
- name: 'Install Nix'
uses: cachix/[email protected]
with:
install_url: https://releases.nixos.org/nix/nix-2.24.12/install
extra_nix_config: |
substituters = http://cache.nixos.org https://cache.iog.io
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
# note: we install uv from the nix flake in order to match the uv version that is used by uv2nix
- name: 'Install uv'
- name: 'Get uv release'
id: uv_release
run: |
nix profile install .#uv
uv --version
echo uv_version=$(cat deps/uv_release) >> "${GITHUB_OUTPUT}"
- name: 'Install uv'
uses: astral-sh/setup-uv@v6
with:
version: ${{ steps.uv_release.outputs.uv_version }}
- name: 'Run code quality checks'
run: make check
- name: 'Run pyupgrade'
Expand All @@ -39,18 +35,14 @@ jobs:
steps:
- name: 'Check out code'
uses: actions/checkout@v4
- name: 'Install Nix'
uses: cachix/[email protected]
with:
install_url: https://releases.nixos.org/nix/nix-2.24.12/install
extra_nix_config: |
substituters = http://cache.nixos.org https://cache.iog.io
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
# note: we install uv from the nix flake in order to match the uv version that is used by uv2nix
- name: 'Install uv'
- name: 'Get uv release'
id: uv_release
run: |
nix profile install .#uv
uv --version
echo uv_version=$(cat deps/uv_release) >> "${GITHUB_OUTPUT}"
- name: 'Install uv'
uses: astral-sh/setup-uv@v6
with:
version: ${{ steps.uv_release.outputs.uv_version }}
- name: 'Run unit tests'
run: make cov-unit

Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,20 @@ jobs:
with:
name: k-framework
authToken: ${{ secrets.CACHIX_PUBLIC_TOKEN }}
# note: we install uv from the nix flake in order to match the uv version that is used by uv2nix
- name: 'Install uv'
# note: we install the same version of `uv` as used by `uv2nix` in order to match the nix derivation
- name: 'Update uv release tag'
id: uv_release
run: |
nix profile install .#uv
uv --version
UV2NIX_VERSION=$(cat deps/uv2nix)
UV_VERSION=$(curl -s https://raw.githubusercontent.com/pyproject-nix/uv2nix/$(cat deps/uv2nix)/pkgs/uv-bin/srcs.json | jq -r .version)
[[ "$UV_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]
echo $UV_VERSION > deps/uv_release
git add deps/uv_release && git commit -m "Sync uv version: uv ${UV_VERSION}" || true
echo uv_version=$UV_VERSION >> "${GITHUB_OUTPUT}"
- name: 'Install uv'
uses: astral-sh/setup-uv@v6
with:
version: ${{ steps.uv_release.outputs.uv_version }}
- name: 'Update kevm-pyk release tag'
run: |
KEVM_VERSION="$(cat deps/kevm_release)"
Expand Down
1 change: 1 addition & 0 deletions deps/uv_release
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.7.2