Skip to content

Commit 013b97b

Browse files
Bump prek to 0.3.4 and auto-update (#84)
1 parent f239b24 commit 013b97b

4 files changed

Lines changed: 20 additions & 14 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ repos:
3030
- validate-pyproject-schema-store[all]>=2025.11.14
3131

3232
- repo: https://github.com/astral-sh/ruff-pre-commit
33-
rev: v0.15.2
33+
rev: v0.15.4
3434
hooks:
3535
- id: ruff-check
3636
args: ["--fix", "--show-fixes", "--unsafe-fixes"]
@@ -45,7 +45,7 @@ repos:
4545
args: ["--ignore-words-list=lief,LIEF", "-w", "--skip=*.rtf"]
4646

4747
- repo: https://github.com/pre-commit/mirrors-clang-format
48-
rev: v21.1.8
48+
rev: v22.1.0
4949
hooks:
5050
- id: clang-format
5151
exclude: (?x)^(src/msilib/include/pythoncapi_compat.h)$

ci/install-tools.sh

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ fi
1313
# Detect environment
1414
IS_CONDA="0"
1515
IS_MINGW="0"
16+
IS_UV="0"
1617
IS_WINDOWS="0"
1718
if [ -n "$CONDA_EXE" ]; then
1819
IS_CONDA="1"
@@ -21,6 +22,7 @@ elif [ -n "$MINGW_PACKAGE_PREFIX" ]; then
2122
elif which python &>/dev/null; then
2223
PY_PLATFORM=$(python -c "import sysconfig; print(sysconfig.get_platform(), end='')")
2324
IS_WINDOWS=$([[ $PY_PLATFORM == win* ]] && echo "1")
25+
IS_UV="1"
2426
else
2527
echo "error: Python is required."
2628
exit 1
@@ -128,12 +130,9 @@ else
128130
env UV_INSTALL_DIR="$INSTALL_DIR" sh
129131
fi
130132

131-
# Lief is not available for Python 3.13t and 3.14t
132-
PY_VERSION=$(python -c "import sysconfig; print(sysconfig.get_python_version(), end='')")
133+
# Lief is not available for Python free-threaded
133134
PY_ABI_THREAD=$(python -c "import sysconfig; print(sysconfig.get_config_var('abi_thread') or '', end='')")
134-
PY_VER_ABI="$PY_VERSION$PY_ABI_THREAD"
135-
if [ "$IS_WINDOWS" == "1" ] && \
136-
{ [ "$PY_VER_ABI" == "3.13t" ] || [ "$PY_VER_ABI" == "3.14t" ]; }; then
135+
if [ "$IS_WINDOWS" == "1" ] && [ "$PY_ABI_THREAD" == "t" ]; then
137136
# Packages to install
138137
pkgs=()
139138

@@ -182,11 +181,18 @@ if [ "$INSTALL_DEV" == "1" ]; then
182181
PY_VER_ABI="$PY_VERSION$PY_ABI_THREAD"
183182
while read -r line; do
184183
name=$(echo "$line" | awk -F '[><=]+' '{ print $1 }')
185-
filename=$INSTALL_DIR/$name
186-
echo "Create $filename"
187-
echo "#!/bin/sh"> "$filename"
188-
echo "uvx -p $PY_VER_ABI \"$line\" \$@">> "$filename"
189-
chmod +x "$filename"
184+
# prek has no dependencies (doesn't bloat the installed packages)
185+
if [ "$name" == "prek" ] && [ "$IS_CONDA" == "1" ]; then
186+
$CONDA_EXE install -c conda-forge "$name" -S -q -y
187+
elif [ "$name" == "prek" ] && [ "$IS_UV" == "1" ]; then
188+
uv pip install --upgrade "$name"
189+
else
190+
filename=$INSTALL_DIR/$name
191+
echo "Create $filename"
192+
echo "#!/bin/sh"> "$filename"
193+
echo "uvx -p $PY_VER_ABI \"$line\" \$@">> "$filename"
194+
chmod +x "$filename"
195+
fi
190196
done < requirements-dev.txt
191197
fi
192198
fi

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Documentation = "https://docs.python.org/3.12/library/msilib.html"
4747
[dependency-groups]
4848
dev = [
4949
"cibuildwheel==3.3.1",
50-
"prek==0.3.3",
50+
"prek==0.3.4",
5151
]
5252
tests = [
5353
"coverage==7.13.4",

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
cibuildwheel==3.3.1
2-
prek==0.3.3
2+
prek==0.3.4

0 commit comments

Comments
 (0)