Skip to content

Commit c32c1cc

Browse files
Make uv2nix and pyproject-build-systems updatable by CI (#1028)
* make uv2nix and pyproject-build-systems updatable by CI * install uv from flake in workflows and print version * run update-version on `uv2nix` and `pyproject-build-systems` updates --------- Co-authored-by: automergerpr-permission-manager[bot] <190534181+automergerpr-permission-manager[bot]@users.noreply.github.com>
1 parent 96012bb commit c32c1cc

File tree

5 files changed

+49
-19
lines changed

5 files changed

+49
-19
lines changed

.github/workflows/test-pr.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,18 @@ jobs:
1515
steps:
1616
- name: 'Check out code'
1717
uses: actions/checkout@v4
18-
- name: 'Install uv'
19-
uses: astral-sh/setup-uv@v5
18+
- name: 'Install Nix'
19+
uses: cachix/[email protected]
2020
with:
21-
version: 0.7.2
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'
27+
run: |
28+
nix profile install .#uv
29+
uv --version
2230
- name: 'Run code quality checks'
2331
run: make check
2432
- name: 'Run pyupgrade'
@@ -31,10 +39,18 @@ jobs:
3139
steps:
3240
- name: 'Check out code'
3341
uses: actions/checkout@v4
34-
- name: 'Install uv'
35-
uses: astral-sh/setup-uv@v5
42+
- name: 'Install Nix'
43+
uses: cachix/[email protected]
3644
with:
37-
version: 0.7.2
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'
51+
run: |
52+
nix profile install .#uv
53+
uv --version
3854
- name: 'Run unit tests'
3955
run: make cov-unit
4056

.github/workflows/update-version.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches:
66
- '_update-deps/runtimeverification/evm-semantics'
7+
- '_update-deps-cron/uv2nix'
8+
- '_update-deps-cron/pyproject-build-systems'
79
workflow_dispatch:
810
# Stop in progress workflows on the same branch and same workflow to use latest committed code
911
concurrency:
@@ -25,10 +27,18 @@ jobs:
2527
run: |
2628
git config user.name devops
2729
git config user.email [email protected]
28-
- name: 'Install uv'
29-
uses: astral-sh/setup-uv@v5
30+
- name: 'Install Nix'
31+
uses: cachix/[email protected]
3032
with:
31-
version: 0.7.2
33+
install_url: https://releases.nixos.org/nix/nix-2.24.12/install
34+
extra_nix_config: |
35+
substituters = http://cache.nixos.org https://cache.iog.io
36+
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
37+
# note: we install uv from the nix flake in order to match the uv version that is used by uv2nix
38+
- name: 'Install uv'
39+
run: |
40+
nix profile install .#uv
41+
uv --version
3242
- name: 'Update kevm-pyk release tag'
3343
run: |
3444
KEVM_VERSION="$(cat deps/kevm_release)"
@@ -53,7 +63,11 @@ jobs:
5363
- name: 'Update Nix flake inputs'
5464
run: |
5565
KEVM_VERSION=$(cat deps/kevm_release)
66+
UV2NIX_VERSION=$(cat deps/uv2nix)
67+
PYPROJECT_BUILD_SYSTEMS_VERSION=$(cat deps/pyproject-build-systems)
5668
sed -i 's! kevm.url = "github:runtimeverification/evm-semantics/[v0-9\.]*"! kevm.url = "github:runtimeverification/evm-semantics/v'"${KEVM_VERSION}"'"!' flake.nix
69+
sed -i 's! uv2nix.url = "github:pyproject-nix/uv2nix/[a-z0-9\.]*"! uv2nix.url = "github:pyproject-nix/uv2nix/'"${UV2NIX_VERSION}"'"!' flake.nix
70+
sed -i 's! pyproject-build-systems.url = "github:pyproject-nix/build-system-pkgs/[a-z0-9\.]*"! pyproject-build-systems.url = "github:pyproject-nix/build-system-pkgs/'"${PYPROJECT_BUILD_SYSTEMS_VERSION}"'"!' flake.nix
5771
nix flake update
5872
git add flake.nix flake.lock && git commit -m 'flake.{nix,lock}: update Nix derivations' || true
5973
- name: 'Push updates'

deps/pyproject-build-systems

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

deps/uv2nix

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

flake.nix

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,14 @@
1818
inputs.nixpkgs.follows = "nixpkgs";
1919
inputs.flake-utils.follows = "flake-utils";
2020
};
21-
uv2nix = {
22-
url = "github:pyproject-nix/uv2nix/680e2f8e637bc79b84268949d2f2b2f5e5f1d81c"; #
23-
# stale nixpkgs is missing the alias `lib.match` -> `builtins.match`
24-
# therefore point uv2nix to a patched nixpkgs, which introduces this alias
25-
# this is a temporary solution until nixpkgs us up-to-date again
26-
inputs.nixpkgs.url = "github:runtimeverification/nixpkgs/libmatch";
27-
# inputs.nixpkgs.follows = "nixpkgs";
28-
# uv2nix already makes their input flakes follow their nixpkgs
29-
};
21+
uv2nix.url = "github:pyproject-nix/uv2nix/680e2f8e637bc79b84268949d2f2b2f5e5f1d81c";
22+
# stale nixpkgs is missing the alias `lib.match` -> `builtins.match`
23+
# therefore point uv2nix to a patched nixpkgs, which introduces this alias
24+
# this is a temporary solution until nixpkgs us up-to-date again
25+
uv2nix.inputs.nixpkgs.url = "github:runtimeverification/nixpkgs/libmatch";
26+
# inputs.nixpkgs.follows = "nixpkgs";
27+
pyproject-build-systems.url = "github:pyproject-nix/build-system-pkgs/7dba6dbc73120e15b558754c26024f6c93015dd7";
3028
pyproject-build-systems = {
31-
url = "github:pyproject-nix/build-system-pkgs/7dba6dbc73120e15b558754c26024f6c93015dd7";
3229
inputs.nixpkgs.follows = "uv2nix/nixpkgs";
3330
inputs.uv2nix.follows = "uv2nix";
3431
inputs.pyproject-nix.follows = "uv2nix/pyproject-nix";
@@ -137,6 +134,7 @@
137134
};
138135
packages = rec {
139136
kontrol = pkgs.kontrol;
137+
uv = pkgs.uv;
140138
default = kontrol;
141139
};
142140
}) // {

0 commit comments

Comments
 (0)