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
6 changes: 3 additions & 3 deletions .github/workflows/cmd.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Command

on:
on: # zizmor: ignore[dangerous-triggers]
issue_comment:
types: [created]

concurrency:
group: pypi-${{ github.ref }}
group: cmd-${{ github.ref }}
cancel-in-progress: false

permissions:
Expand All @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@e14015d583714f6e62063499dc959a02595150a1 # v2.21.1
uses: step-security/harden-runner@ccd8616d44fd3846e67624a50d5aad6d37bf2d25 # v2.22.1
with:
egress-policy: audit

Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/abravalheri/validate-pyproject
rev: 17e12779811926f000bdfa1795f9e3735dd71ac3 # frozen: 0.26
rev: 82d21874c3242e4dc27bb47641c996902ef64eef # frozen: v0.27
hooks:
- id: validate-pyproject
additional_dependencies:
- validate-pyproject-schema-store[all]==2026.10.11

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 44b5042edab9382aba712eed4f9c7bab7a3d6a3e # frozen: v0.17.0
rev: f368fb366ff7f2f808dd324b83a6d32267799e19 # frozen: v0.17.2
hooks:
- id: ruff-check
args: ["--fix", "--show-fixes", "--unsafe-fixes"]
Expand Down Expand Up @@ -60,13 +60,13 @@ repos:
- id: shellcheck

- repo: https://github.com/astral-sh/ty-pre-commit
rev: ded8634232ffc633dc66d44f1b0dfe2bdf766542 # frozen: v0.0.86
rev: 44e0d809f7977451fe65f3697106f594b0a02492 # frozen: v0.0.91
hooks:
- id: ty
args: [--no-sync]

- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: fa412071e4f5d44d44f9e365f4676f9df92456a2 # frozen: v1.30.1
rev: c92afdf2c6ca336aaa8f39e2bd8d48f62dbd8e1f # frozen: v1.31.1
hooks:
- id: zizmor
args: ["--fix=all", "--no-progress", "-p"]
Expand Down
5 changes: 4 additions & 1 deletion ci/build-wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,10 @@ if [ "$INSTALL" == "1" ]; then
$CONDA_EXE install "$PKG_CONDA" --no-deps --yes
else
if [ "$IS_MINGW" == "1" ]; then
PIP_COMMAND="pip install --break-system-packages --force-reinstall"
pacman -R "$MINGW_PACKAGE_PREFIX-python-${NORMALIZED_NAME/_/-}" \
-dd --noconfirm || true
pip uninstall --break-system-packages "$NORMALIZED_NAME" -y || true
PIP_COMMAND="pip install --break-system-packages --ignore-installed"
else
PIP_COMMAND="uv pip install --no-build --prerelease=allow --reinstall"
fi
Expand Down
82 changes: 46 additions & 36 deletions ci/install-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,26 @@ if [ "$IS_CONDA" == "1" ]; then
done < requirements.txt
fi

# pytest and dependencies
# Dependencies for 'dev'
if [ -f requirements-dev.txt ]; then
SYS_PLATFORM=$(python -c "import sys; print(sys.platform, end='')")
while read -r line; do
if [[ $line != *sys_platform* ]] || \
[[ $line == *sys_platform*==*${SYS_PLATFORM}* ]]; then
name=$(echo "$line" | awk -F '[><=]+' '{ print $1 }')
if [ "$name" == "cibuildwheel" ]; then continue; fi
if ! printf '%s\0' "${pkgs[@]}" | grep -Fxqz -- "$name"; then
pkgs+=("$name")
fi
fi
done < requirements-dev.txt
fi

# Dependencies for 'tests'
if [ "$INSTALL_TESTS" == "1" ] && [ -f tests/requirements.txt ]; then
while read -r line; do
name=$(echo "$line" | awk -F '[><=]+' '{ print $1 }')
if [ "$name" == "cx-freeze" ]; then name="cx_freeze"; fi
pkgs+=("$name")
done < tests/requirements.txt
fi
Expand Down Expand Up @@ -139,7 +155,25 @@ elif [ "$IS_MINGW" == "1" ]; then
done < requirements.txt
fi

# pytest and dependencies
# Dependencies for 'dev'
if [ -f requirements-dev.txt ]; then
while read -r line; do
if [[ $line != *sys_platform* ]] || \
[[ $line == *sys_platform*==*win32* ]]; then
name=$(echo "$line" | awk -F '[><=]+' '{ print $1 }')
if [ "$name" == "cibuildwheel" ]; then continue; fi
if [ "$name" == "prek" ]; then
pkgs+=("$MINGW_PACKAGE_PREFIX-$name")
continue
fi
if ! printf '%s\0' "${pkgs[@]}" | grep -Fxqz -- "$name"; then
pkgs+=("$MINGW_PACKAGE_PREFIX-python-$name")
fi
fi
done < requirements-dev.txt
fi

# Dependencies for 'tests'
if [ "$INSTALL_TESTS" == "1" ] && [ -f tests/requirements.txt ]; then
while read -r line; do
name=$(echo "$line" | awk -F '[><=]+' '{ print $1 }')
Expand All @@ -148,7 +182,7 @@ elif [ "$IS_MINGW" == "1" ]; then
fi

echo "Install packages"
pacman --needed --noconfirm --quiet -S "${pkgs[@]}"
pacman -S --needed --noconfirm --quiet "${pkgs[@]}"
else
if [ "$CI" == "true" ]; then
if [ "$IS_WINDOWS" == "1" ]; then
Expand All @@ -170,47 +204,23 @@ else
else
uv pip install --upgrade -r pyproject.toml
fi
fi

# Get Python version
PY_VERSION=$(python -c "import sysconfig; print(sysconfig.get_python_version(), end='')")
PY_ABI_THREAD=$(python -c "import sysconfig; print(sysconfig.get_config_var('abi_thread') or '', end='')")

# Install dev tools
if [ "$INSTALL_DEV" == "1" ]; then
if [ -f requirements-dev.txt ]; then
PY_VER_ABI="$PY_VERSION$PY_ABI_THREAD"
if [ "$PY_VERSION" == "3.10" ] || [ "$PY_VERSION" == "3.11" ]; then
PY_VER_ABI="3.12"
fi
# Install dev tools
PY_VER_FOR_TOOLS="3.12"
if [ "$INSTALL_DEV" == "1" ] && [ -f requirements-dev.txt ]; then
while read -r line; do
name=$(echo "$line" | awk -F '[><=]+' '{ print $1 }')
# 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" != "cibuildwheel" ] && [ "$IS_UV" == "1" ]; then
uv pip install --upgrade "$name"
elif [ "$IS_UV" == "1" ]; then
uv tool install -p "$PY_VER_ABI" "$line"
if [ "$name" == "cibuildwheel" ] && [ "$IS_UV" == "1" ]; then
uv tool install -p "$PY_VER_FOR_TOOLS" "$line"
else
filename=$INSTALL_DIR/$name
echo "Create $filename"
echo "#!/bin/sh"> "$filename"
echo "uvx -p $PY_VER_ABI \"$line\" \$@">> "$filename"
chmod +x "$filename"
uv pip install "$name"
fi
done < requirements-dev.txt
fi
fi

# Install doc tools (sphinx and extensions)
if [ "$INSTALL_DOC" == "1" ]; then
if [ -f doc/requirements.txt ]; then
PY_VER_ABI="$PY_VERSION$PY_ABI_THREAD"
if [ "$PY_VERSION" == "3.10" ] || [ "$PY_VERSION" == "3.11" ]; then
PY_VER_ABI="3.12"
fi
uv tool install -p "$PY_VER_ABI" \
# Install doc tools (sphinx and extensions)
if [ "$INSTALL_DOC" == "1" ] && [ -f doc/requirements.txt ]; then
uv tool install -p "$PY_VER_FOR_TOOLS" \
--with-requirements=doc/requirements.txt sphinx
fi
fi
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ Documentation = "https://docs.python.org/3.12/library/msilib.html"

[dependency-groups]
dev = [
"cibuildwheel>=4.3.1",
"prek>=0.5.5,<0.6.0",
"cibuildwheel>=4.3.4",
"prek>=0.5.7,<0.6.0",
]
tests = [
"coverage>=7.13.0",
Expand Down
4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cibuildwheel>=4.3.1
prek>=0.5.5,<0.6.0
cibuildwheel>=4.3.4
prek>=0.5.7,<0.6.0
Loading