diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 027feb11284..6019dda7949 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -103,3 +103,11 @@ repos: language: system entry: CI/check_math_macros.py files: \.(cpp|hpp|ipp|cu|cuh)$ + + - repo: local + hooks: + - id: codegen_dependencies + name: codegen_dependencies + language: system + entry: CI/check_codegen_dependencies.sh + files: pyproject.toml$ diff --git a/CI/check_codegen_dependencies.sh b/CI/check_codegen_dependencies.sh new file mode 100755 index 00000000000..aa666346992 --- /dev/null +++ b/CI/check_codegen_dependencies.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -e +set -u + +PYTHON_VERSION=3.13 + +input=$1 +input_abs=$(realpath "$input") +input_rel=$(basename "$input_abs") +dir=$(dirname "$input_abs") +output=requirements.txt + +pushd $dir +uv pip compile -p $PYTHON_VERSION "$input_rel" -o "$output" +popd