You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by "jiengup (via GitHub)" <gi...@apache.org> on 2026/10/06 17:27:05 UTC

[PR] chore(python): require Python 3.11 across SDK and CI [iggy]

jiengup opened a new pull request, #4421:
URL: https://github.com/apache/iggy/pull/4421

   ## Which issue does this PR address?
   
   N/A
   
   ## Rationale
   
   `upstream/master` still declares Python 3.10 as supported. This change raises the Python SDK minimum to 3.11 and aligns package metadata, development environments, examples, and wheel builds with that decision. It currently removes 3.10 support directly, without a prior deprecation notice.
   
   ## What changed?
   
   - Raise the minimum supported Python version from 3.10 to 3.11 across the SDK, BDD tests, examples, interpreter pins, CI configuration, and documentation.
   - Regenerate the lock files for the supported range, removing Python 3.10-only dependencies and wheel records. Update the example enum to use `StrEnum`.
   - Keep the generated `Durability` stub consistent with the runtime enum. A targeted `UP042` suppression prevents Ruff from suggesting a change with different `str()` behavior.
   - Derive Linux and macOS wheel interpreters from the SDK’s Python classifiers, align the Windows matrix, and verify the Python compatibility metadata in release artifacts.
   
   ## Points for discussion
   
   1. **`UP042` suppression:** Should the targeted `noqa` remain? Removing only the marker fails Ruff; changing the stub to `StrEnum` would describe different `str(Durability.REPLICATED)` behavior. Changing the runtime enum as well would change observable SDK behavior and needs an explicit compatibility decision.
   2. **Python SDK version:** The SDK remains at `0.9.1.dev1`. Which version should first enforce Python 3.11: the `0.9.1` line, a new minor line such as `0.10.0`, or another planned release? Once decided, `Cargo.toml`, `pyproject.toml`, and release tags should agree.
   3. **Announcement timing:** Which Iggy release should first announce Python 3.10 deprecation, and which SDK release should actually stop supporting it? Should the Iggy website prominently call out the new Python 3.11 minimum in the Python SDK documentation and release notes?
   
   ## Local Execution
   
   - Passed: Rust extension unit tests (20); Python 3.11 unit tests (220), non-TLS integration tests (613), Docker TLS tests (6), Docker BDD scenarios (4), and the Python examples including TLS.
   - Passed: Python 3.12.15 and 3.13.16 unit tests (220 each) in Docker; interpreter synchronization and all three `uv.lock` checks.
   - Local limitation: the repository’s unchanged BDD script copies macOS binaries into a Linux server image. The BDD scenarios were instead run in a Linux Python container against both a server from this checkout and a Linux Iggy 0.9.0 container. The TLS fixture used temporary OrbStack-specific container settings. **The release wheel matrix was not run locally**.
   - Pre-commit hooks: `prek run -a` passed.
   
   ## AI Usage
   
   Codex assisted with branch analysis and local verification.
   All changes is reviewed by human.


-- 
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: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(python): require Python 3.11 across SDK and CI [iggy]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #4421:
URL: https://github.com/apache/iggy/pull/4421#issuecomment-6022624907

   ## [Codecov](https://app.codecov.io/gh/apache/iggy/pull/4421?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 87.97%. Comparing base ([`f6dfbdb`](https://app.codecov.io/gh/apache/iggy/commit/f6dfbdbb379be2140c453c0702975c256bc4f995?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`8fdf759`](https://app.codecov.io/gh/apache/iggy/commit/8fdf7594ce63004ba6d50b184d70aa2d9563d5bb?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 1 commits behind head on master.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #4421      +/-   ##
   ============================================
   + Coverage     87.91%   87.97%   +0.05%     
     Complexity     1578     1578              
   ============================================
     Files          1298     1298              
     Lines        233811   233811              
     Branches     194562   194560       -2     
   ============================================
   + Hits         205563   205700     +137     
   + Misses        23339    23171     -168     
   - Partials       4909     4940      +31     
   ```
   
   | [Components](https://app.codecov.io/gh/apache/iggy/pull/4421/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [Rust Core](https://app.codecov.io/gh/apache/iggy/pull/4421/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `89.10% <ø> (-0.05%)` | :arrow_down: |
   | [Java SDK](https://app.codecov.io/gh/apache/iggy/pull/4421/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `68.72% <ø> (ø)` | |
   | [C# SDK](https://app.codecov.io/gh/apache/iggy/pull/4421/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `77.62% <ø> (+0.01%)` | :arrow_up: |
   | [Python SDK](https://app.codecov.io/gh/apache/iggy/pull/4421/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `91.24% <ø> (ø)` | |
   | [PHP SDK](https://app.codecov.io/gh/apache/iggy/pull/4421/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `85.67% <ø> (ø)` | |
   | [Node SDK](https://app.codecov.io/gh/apache/iggy/pull/4421/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `96.59% <ø> (+1.70%)` | :arrow_up: |
   | [Go SDK](https://app.codecov.io/gh/apache/iggy/pull/4421/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `70.26% <ø> (ø)` | |
   | [C++ SDK](https://app.codecov.io/gh/apache/iggy/pull/4421/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `86.60% <ø> (ø)` | |
   [see 44 files with indirect coverage changes](https://app.codecov.io/gh/apache/iggy/pull/4421/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(python): require Python 3.11 across SDK and CI [iggy]

Posted by "jiengup (via GitHub)" <gi...@apache.org>.
jiengup commented on PR #4421:
URL: https://github.com/apache/iggy/pull/4421#issuecomment-6107135554

   /ready


-- 
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: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(python): require Python 3.11 across SDK and CI [iggy]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #4421:
URL: https://github.com/apache/iggy/pull/4421#issuecomment-6021738368

   <!-- iggy-pr-triage-welcome -->
   Thanks for the PR. It is labeled `S-waiting-on-review` and queued for review.
   
   Slash commands (own line, regular comment) move it around the queue:
   
   - `/ready` - back to `S-waiting-on-review` after addressing feedback
   - `/author` - flip to `S-waiting-on-author` while you finish changes
   - `/request-review @user-or-team` - request a reviewer
   - `/pin` - exempt the PR from the stale bot, `/unpin` to undo
   
   See [CONTRIBUTING.md](https://github.com/apache/iggy/blob/master/CONTRIBUTING.md#pr-triage-commands) for details.


-- 
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: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(python): require Python 3.11 across SDK and CI [iggy]

Posted by "slbotbm (via GitHub)" <gi...@apache.org>.
slbotbm commented on PR #4421:
URL: https://github.com/apache/iggy/pull/4421#issuecomment-6028892350

   @jiengup i remember there being one feature in asyncio that was 3.11 compatible but not 3.10, due to which we needed to change the how the tests ran. can you check that please? 


-- 
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: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(python): require Python 3.11 across SDK and CI [iggy]

Posted by "jiengup (via GitHub)" <gi...@apache.org>.
jiengup commented on PR #4421:
URL: https://github.com/apache/iggy/pull/4421#issuecomment-6059555501

   @slbotbm 
   I checked the Python SDK and BDD tests and found no use of an asyncio API that would prevent them from moving from Python 3.10 to 3.11. BDD steps call asyncio.run() (https://docs.python.org/3.11/library/asyncio-runner.html#asyncio.run), available since 3.7; SDK tests also use asyncio.to_thread() (https://docs.python.org/3.11/library/asyncio-task.html#asyncio.to_thread), available since 3.9.
   
   The relevant 3.11-only API is asyncio.Runner (https://docs.python.org/3.11/library/asyncio-runner.html#asyncio.Runner), which pytest-asyncio uses internally. Its v1.4.0 source (https://github.com/pytest-dev/pytest-asyncio/blob/6e14cd2af9292dca1fa2b027a06bbc40b0e0e425/pytest_asyncio/plugin.py#L57) imports the standard-library Runner on Python 3.11+ and a backport on older versions(. That explains why backports-asyncio-runner disappeared from the regenerated lock files.
   
   On Python 3.11.16, the local SDK unit run passed 220 tests. Server-backed integration and BDD tests were not run as part of this check, so their runtime behavior still needs CI verification.


-- 
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: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(python): require Python 3.11 across SDK and CI [iggy]

Posted by "jiengup (via GitHub)" <gi...@apache.org>.
jiengup commented on PR #4421:
URL: https://github.com/apache/iggy/pull/4421#issuecomment-6059560067

   /ready


-- 
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: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(python): require Python 3.11 across SDK and CI [iggy]

Posted by "hubcio (via GitHub)" <gi...@apache.org>.
hubcio commented on PR #4421:
URL: https://github.com/apache/iggy/pull/4421#issuecomment-6099575535

   /skill team-review-slim


-- 
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: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(python): require Python 3.11 across SDK and CI [iggy]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
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/setup-python@v7.0.0
         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: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(python): require Python 3.11 across SDK and CI [iggy]

Posted by "hubcio (via GitHub)" <gi...@apache.org>.
hubcio merged PR #4421:
URL: https://github.com/apache/iggy/pull/4421


-- 
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: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org