Skip to content
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: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ repos:
- validate-pyproject-schema-store[all]>=2025.11.14

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

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v21.1.8
rev: v22.1.0
hooks:
- id: clang-format
exclude: (?x)^(src/msilib/include/pythoncapi_compat.h)$
Expand Down
26 changes: 16 additions & 10 deletions ci/install-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ fi
# Detect environment
IS_CONDA="0"
IS_MINGW="0"
IS_UV="0"
IS_WINDOWS="0"
if [ -n "$CONDA_EXE" ]; then
IS_CONDA="1"
Expand All @@ -21,6 +22,7 @@ elif [ -n "$MINGW_PACKAGE_PREFIX" ]; then
elif which python &>/dev/null; then
PY_PLATFORM=$(python -c "import sysconfig; print(sysconfig.get_platform(), end='')")
IS_WINDOWS=$([[ $PY_PLATFORM == win* ]] && echo "1")
IS_UV="1"
else
echo "error: Python is required."
exit 1
Expand Down Expand Up @@ -128,12 +130,9 @@ else
env UV_INSTALL_DIR="$INSTALL_DIR" sh
fi

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

Expand Down Expand Up @@ -182,11 +181,18 @@ if [ "$INSTALL_DEV" == "1" ]; then
PY_VER_ABI="$PY_VERSION$PY_ABI_THREAD"
while read -r line; do
name=$(echo "$line" | awk -F '[><=]+' '{ print $1 }')
filename=$INSTALL_DIR/$name
echo "Create $filename"
echo "#!/bin/sh"> "$filename"
echo "uvx -p $PY_VER_ABI \"$line\" \$@">> "$filename"
chmod +x "$filename"
# prek has no dependencies (doesn't bloat the installed packages)
if [ "$name" == "prek" ] && [ "$IS_CONDA" == "1" ]; then
$CONDA_EXE install -c conda-forge "$name" -S -q -y
elif [ "$name" == "prek" ] && [ "$IS_UV" == "1" ]; then
uv pip install --upgrade "$name"
else
filename=$INSTALL_DIR/$name
echo "Create $filename"
echo "#!/bin/sh"> "$filename"
echo "uvx -p $PY_VER_ABI \"$line\" \$@">> "$filename"
chmod +x "$filename"
fi
done < requirements-dev.txt
fi
fi
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Documentation = "https://docs.python.org/3.12/library/msilib.html"
[dependency-groups]
dev = [
"cibuildwheel==3.3.1",
"prek==0.3.3",
"prek==0.3.4",
]
tests = [
"coverage==7.13.4",
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cibuildwheel==3.3.1
prek==0.3.3
prek==0.3.4
Loading