Skip to content

Commit ce74444

Browse files
Update dev tools (#81)
1 parent 30c8286 commit ce74444

5 files changed

Lines changed: 39 additions & 37 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ repos:
1212
- id: check-added-large-files
1313
- id: check-case-conflict
1414
- id: check-merge-conflict
15-
- id: check-shebang-scripts-are-executable
15+
- id: check-executables-have-shebangs
1616
- id: check-symlinks
1717
- id: check-toml
1818
- id: check-yaml
@@ -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.1
33+
rev: v0.15.2
3434
hooks:
3535
- id: ruff-check
3636
args: ["--fix", "--show-fixes", "--unsafe-fixes"]

ci/bump-version.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ git commit -m "Bump version: ${VERSION} → ${NEW_VERSION} [ci skip]" -a
8484
git log -1
8585
if ! [ "$CI" == "true" ]; then
8686
git push origin "$(git branch --show-current)"
87-
git push origin "$(git branch --show-current)" --tags
87+
if ! (echo "$NEW_VERSION" | grep -q "\.dev"); then
88+
git tag -s "$NEW_VERSION" -m "Bump version: ${NEW_VERSION}"
89+
git push origin "$(git branch --show-current)" --tags
90+
fi
8891
fi
8992
echo "::endgroup::"

ci/install-tools.sh

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
11
#!/bin/bash
22

3-
INSTALL_DIR="$HOME/bin"
4-
mkdir -p "$INSTALL_DIR"
5-
6-
if which python &>/dev/null; then
7-
PY_PLATFORM=$(python -c "import sysconfig; print(sysconfig.get_platform(), end='')")
8-
elif [ -z "$MINGW_PACKAGE_PREFIX" ]; then
9-
PY_PLATFORM="mingw"
10-
else
11-
PY_PLATFORM=""
12-
fi
13-
14-
IS_CONDA=$([ -n "$CONDA_EXE" ] && echo "1")
15-
IS_MINGW=$([[ $PY_PLATFORM == mingw* ]] && echo "1")
16-
IS_WINDOWS=$([[ $PY_PLATFORM == win* ]] && echo "1")
17-
183
# Usage
194
if [ -n "$1" ] && [ "$1" == "--help" ]; then
205
echo "Usage:"
@@ -25,6 +10,26 @@ if [ -n "$1" ] && [ "$1" == "--help" ]; then
2510
exit 1
2611
fi
2712

13+
# Detect environment
14+
IS_CONDA="0"
15+
IS_MINGW="0"
16+
IS_WINDOWS="0"
17+
if [ -n "$CONDA_EXE" ]; then
18+
IS_CONDA="1"
19+
elif [ -n "$MINGW_PACKAGE_PREFIX" ]; then
20+
IS_MINGW="1"
21+
elif which python &>/dev/null; then
22+
PY_PLATFORM=$(python -c "import sysconfig; print(sysconfig.get_platform(), end='')")
23+
IS_WINDOWS=$([[ $PY_PLATFORM == win* ]] && echo "1")
24+
else
25+
echo "error: Python is required."
26+
exit 1
27+
fi
28+
29+
# Install/update dev tools (including uv if required)
30+
INSTALL_DIR="$HOME/bin"
31+
mkdir -p "$INSTALL_DIR"
32+
2833
INSTALL_DEV=""
2934
INSTALL_TESTS=""
3035
while [ -n "$1" ]; do
@@ -39,28 +44,28 @@ while [ -n "$1" ]; do
3944
done
4045

4146
echo "::group::Install dependencies and build tools"
42-
# Install/update uv and dev tools
4347
if [ "$IS_CONDA" == "1" ]; then
44-
# Conda Python 3.14: python-msilib is not available yet
45-
PY_VERSION=$(python -c "import sysconfig; print(sysconfig.get_python_version(), end='')")
46-
SYS_PLATFORM=$(python -c "import sys; print(sys.platform, end='')")
47-
# Packages to install
48-
pkgs=("uv" "python-build")
48+
# Install libmamba-solver and use it to speed up packages installation
49+
echo "Update conda to use libmamba-solver"
50+
$CONDA_EXE clean --index-cache --logfiles --quiet --yes
51+
$CONDA_EXE update -n base conda --quiet --yes
52+
$CONDA_EXE install -n base conda-libmamba-solver --quiet --yes
53+
$CONDA_EXE config --set solver libmamba
4954
if ! which python &>/dev/null; then
50-
pkgs+=("python=3.13")
55+
$CONDA_EXE install -c conda-forge python -S -q -y
5156
fi
57+
# Packages to install
58+
pkgs=("python-build")
5259

5360
# Dependencies of the project
5461
if [ -f requirements.txt ]; then
62+
SYS_PLATFORM=$(python -c "import sys; print(sys.platform, end='')")
5563
while read -r line; do
5664
if [[ $line != *sys_platform* ]] || \
5765
[[ $line == *sys_platform*==*${SYS_PLATFORM}* ]]; then
5866
name=$(echo "$line" | awk -F '[><=]+' '{ print $1 }')
5967
if [ "$name" == "cx-logging" ]; then name="cx_logging"; fi
6068
if [ "$name" == "lief" ]; then name="py-lief"; fi
61-
if [ "$name" == "python-msilib" ] && [ "$PY_VERSION" == "3.14" ]; then
62-
continue
63-
fi
6469
if ! printf '%s\0' "${pkgs[@]}" | grep -Fxqz -- "$name"; then
6570
pkgs+=("$name")
6671
fi
@@ -76,18 +81,12 @@ if [ "$IS_CONDA" == "1" ]; then
7681
done < tests/requirements.txt
7782
fi
7883

79-
# Install libmamba-solver and use it to speed up packages installation
80-
echo "Update conda to use libmamba-solver"
81-
$CONDA_EXE clean --index-cache --logfiles --quiet --yes
82-
$CONDA_EXE update -n base conda --quiet --yes
83-
$CONDA_EXE install -n base conda-libmamba-solver --quiet --yes
84-
$CONDA_EXE config --set solver libmamba
8584
echo "Install packages"
8685
echo "${pkgs[@]}"
8786
$CONDA_EXE install -c conda-forge "${pkgs[@]}" -S -q -y
8887
elif [ "$IS_MINGW" == "1" ]; then
8988
# Packages to install
90-
pkgs=("$MINGW_PACKAGE_PREFIX-uv" "$MINGW_PACKAGE_PREFIX-python-build")
89+
pkgs=("$MINGW_PACKAGE_PREFIX-python-build")
9190
if ! which python &>/dev/null; then
9291
pkgs+=("$MINGW_PACKAGE_PREFIX-python")
9392
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.2",
50+
"prek==0.3.3",
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.2
2+
prek==0.3.3

0 commit comments

Comments
 (0)