Skip to content

Commit

Permalink
chore: Add pre-commit hook to test dependency consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgessinger committed Feb 24, 2025
1 parent 0585a69 commit fca8b1a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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$
15 changes: 15 additions & 0 deletions CI/check_codegen_dependencies.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit fca8b1a

Please sign in to comment.