github-actions[bot] commented on code in PR #4421:
URL: https://github.com/apache/iggy/pull/4421#discussion_r4238333460
##########
.github/workflows/_build_python_wheels.yml:
##########
@@ -363,13 +439,13 @@ jobs:
# Runs last so the artifact and the summary survive for inspection
# when a leg is missing. A failed build job uploads nothing, so a
- # short count means one did not contribute. These counts are not
- # derived from the matrices above - update them together.
+ # short count means one did not contribute. Linux and macOS counts
+ # use the release commit's classifiers; Windows has a fixed matrix.
- name: Verify wheel coverage
run: |
- EXPECTED_LINUX=16 # 4 build variants x 4 interpreters
- EXPECTED_MACOS=8 # 2 targets x 4 interpreters
- EXPECTED_WINDOWS=3 # 1 interpreter per job, 3.10 excluded
+ EXPECTED_LINUX=$((4 * ${{ steps.support.outputs.count }})) # 12 for
Python 3.11-3.13
+ EXPECTED_MACOS=$((2 * ${{ steps.support.outputs.count }})) # 6 for
Python 3.11-3.13
+ EXPECTED_WINDOWS=3 # 1 interpreter per job
Review Comment:
warning: `EXPECTED_WINDOWS=3` is a fixed literal, but `ensure_wheel_matrix`
in `scripts/ci/sync-python-interpreter-version.sh` forces the Windows matrix to
list every classifier version. Derive the count from `${{
steps.support.outputs.count }}` as the Linux and macOS lines do. Otherwise a
fourth version fails the check on a complete build and passes it when one
Windows leg is missing.
##########
.github/workflows/_build_python_wheels.yml:
##########
@@ -390,3 +466,42 @@ jobs:
check sdist '*.tar.gz' "$EXPECTED_SDIST"
exit "$missing"
+
+ - name: Verify Python compatibility metadata
+ env:
+ EXPECTED_REQUIRES_PYTHON: ${{ steps.support.outputs.requires_python
}}
+ MINIMUM_VERSION: ${{ steps.support.outputs.minimum_version }}
+ run: |
+ python - <<'PY'
+ from email.parser import Parser
+ from os import environ
+ from pathlib import Path
+ from tarfile import open as open_tar
+ from zipfile import ZipFile
+
+ expected_requires_python = environ["EXPECTED_REQUIRES_PYTHON"]
+ minimum_version = tuple(map(int,
environ["MINIMUM_VERSION"].split(".")))
+ for artifact in Path("dist").iterdir():
+ if artifact.suffix == ".whl":
+ if minimum_version >= (3, 11) and "cp310" in artifact.name:
Review Comment:
warning: The new guard rejects a wheel only when the name holds `cp310`, so
it stops protecting anything after the minimum version moves past 3.11. Parse
the `cpXY` tag from each wheel name and reject every tag below
`minimum_version`.
##########
.github/workflows/_build_python_wheels.yml:
##########
@@ -363,13 +439,13 @@ jobs:
# Runs last so the artifact and the summary survive for inspection
# when a leg is missing. A failed build job uploads nothing, so a
- # short count means one did not contribute. These counts are not
- # derived from the matrices above - update them together.
+ # short count means one did not contribute. Linux and macOS counts
+ # use the release commit's classifiers; Windows has a fixed matrix.
- name: Verify wheel coverage
run: |
- EXPECTED_LINUX=16 # 4 build variants x 4 interpreters
- EXPECTED_MACOS=8 # 2 targets x 4 interpreters
- EXPECTED_WINDOWS=3 # 1 interpreter per job, 3.10 excluded
+ EXPECTED_LINUX=$((4 * ${{ steps.support.outputs.count }})) # 12 for
Python 3.11-3.13
Review Comment:
nit: The two derived counts carry example values such as `12 for Python
3.11-3.13`, and no check keeps them true after a version bump. Drop the
examples and keep the formulas.
##########
scripts/ci/sync-python-interpreter-version.sh:
##########
@@ -296,46 +288,19 @@ ensure_wheel_interpreters() {
return
fi
- classifier_versions=()
- while IFS= read -r _py_cls_tmp; do classifier_versions+=("$_py_cls_tmp");
done < <(read_classifier_versions)
-
- if [ "${#classifier_versions[@]}" -eq 0 ]; then
- echo -e "${RED}✗${NC} $SOURCE_FILE: could not find Python version
classifiers"
- FAILED=1
- return
- fi
-
- for version in "${classifier_versions[@]}"; do
- expected_interpreters+=" python${version}"
- done
- expected_interpreters=${expected_interpreters# }
-
- while IFS= read -r line; do
- total=$((total + 1))
- current_interpreters=$(echo "$line" | sed -E
's/^.*--interpreter[[:space:]]+//')
- if [ "$current_interpreters" != "$expected_interpreters" ]; then
- mismatched=1
- fi
- done < <(grep -- "--interpreter" "$file" || true)
-
- if [ "$total" -eq 0 ]; then
- echo -e "${RED}✗${NC} $file: could not find wheel interpreter list"
- FAILED=1
- return
- fi
-
- if [ "$mismatched" -eq 0 ]; then
- echo -e "${GREEN}✓${NC} $file: wheel interpreter versions"
- return
- fi
-
- if [ "$MODE" = "fix" ]; then
- sed -i.bak -E "s|(--interpreter ).*$|\\1${expected_interpreters}|"
"$file"
- rm -f "$file.bak"
- FIXED_CHECKS=$((FIXED_CHECKS + 1))
- echo -e "${GREEN}Fixed${NC} $file: wheel interpreter versions"
+ interpreter_lines=$(grep -c -- '--interpreter' "$file" || true)
+ # GitHub expressions are literal text here, not shell expansions.
+ # shellcheck disable=SC2016
+ dynamic_lines=$(grep -Fc -- '--interpreter ${{
steps.interpreters.outputs.versions }}' "$file" || true)
+ selector_steps=$(grep -Fc -- '- name: Select wheel interpreters' "$file"
|| true)
Review Comment:
nit: `ensure_wheel_interpreters` counts the display name `Select wheel
interpreters`, so a selector that stops reading `foreign/python/pyproject.toml`
still passes. Match the step id and the `foreign/python/pyproject.toml` path
instead of the display name.
##########
.github/workflows/_build_python_wheels.yml:
##########
@@ -85,7 +85,26 @@ jobs:
- name: Setup Python
uses: actions/[email protected]
with:
- python-version: "3.10"
+ python-version: "3.11"
+
+ - name: Select wheel interpreters
+ id: interpreters
+ run: |
+ python - <<'PY' >> "$GITHUB_OUTPUT"
Review Comment:
simplification: The classifier-to-interpreter block repeats in the linux,
macos and collect jobs, and the macOS copy already differs from the other two.
Move it into one script under `scripts/ci/` that the three steps call, and keep
the step names and output expressions that `ensure_wheel_interpreters` greps
for. Saves about 35 lines.
##########
examples/python/pylock.toml:
##########
@@ -38,46 +38,46 @@ wheels = [
[[packages]]
name = "pyrefly"
-version = "1.2.0"
+version = "1.3.1"
Review Comment:
warning: The changed pin names `pyrefly` 1.3.1, but
`examples/python/uv.lock` locks 1.3.2 and `examples/python/pyproject.toml`
requires `pyrefly>=1.3.2`. The `ruff` pin at line 60 has the same gap.
Regenerate the three `pylock.toml` files with the export command in each header.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]