Skip to content

chore: bump CI Python to 3.13 - #683

Merged
Strum355 merged 3 commits into
mainfrom
feature/python-3.13-ci-upgrade
Oct 29, 2026
Merged

Strum355 merged 3 commits into
mainfrom
feature/python-3.13-ci-upgrade

Conversation

@Strum355

@Strum355 Strum355 commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Description

Due to the error at https://github.com/guacsec/trustify-da-javascript-client/actions/runs/40760713959/job/123071561601 Error: The version '3.9' with architecture 'x64' was not found for Ubuntu 26.04., we have to upgrade to a newer Python version in CI. As a result, some test files need updating as the SBOM outputs have changed due to python_version < "3.10" markers in some of them

Checklist

  • I have followed this repository's contributing guidelines.
  • I will adhere to the project's code of conduct.

Summary by Sourcery

Upgrade CI and Python dependency analysis for Python 3.13 compatibility while keeping generated dependency SBOMs accurate.

Bug Fixes:

  • Correct Poetry dependency tree filtering so package-level markers exclude unsupported dependency subtrees from generated SBOMs.

Enhancements:

  • Constrain pipdeptree to the 3.x release line to avoid introducing incompatible dependencies into analyzed environments.

CI:

  • Upgrade the CI test environment from Python 3.9 to Python 3.13.

Tests:

  • Update Python dependency fixtures and expected SBOM outputs for Python 3.13-compatible results.

Chores:

  • Refresh ignored files and remove obsolete Poetry lint suppression.

@Strum355
Strum355 requested review from a-oren and ruromero October 29, 2026 13:33
@sourcery-ai

sourcery-ai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR moves CI testing from Python 3.9 to 3.13 and updates affected dependency fixtures and golden SBOM snapshots to reflect the package-resolution and output changes caused by Python-version markers.

File-Level Changes

Change Details Files
Upgrade the CI test runtime to Python 3.13 to keep workflow execution compatible with the available Ubuntu runner images.
  • Replace the CI setup-python version from 3.9 to 3.13 while retaining pip caching and existing workflow steps.
.github/workflows/test.yml
Refresh pip and Poetry fixture inputs and golden SBOMs to match Python 3.13 dependency-marker resolution and resulting package metadata.
  • Update the pinned immutables fixture from 0.20 to 0.21 across the affected requirements files.
  • Regenerate expected component and stack SBOM outputs for ignore, virtual-environment, and Poetry test cases.
test/providers/tst_manifests/pip/pip_requirements_txt_ignore/requirements.txt
test/providers/tst_manifests/pip/pip_requirements_txt_ignore/expected_component_sbom.json
test/providers/tst_manifests/pip/pip_requirements_txt_ignore/expected_stack_sbom.json
test/providers/tst_manifests/pip/pip_requirements_txt_no_ignore/requirements.txt
test/providers/tst_manifests/pip/pip_requirements_txt_no_ignore/expected_component_sbom.json
test/providers/tst_manifests/pip/pip_requirements_txt_no_ignore/expected_stack_sbom.json
test/providers/tst_manifests/pip/pip_requirements_virtual_env_txt_no_ignore/requirements.txt
test/providers/tst_manifests/pip/pip_requirements_virtual_env_txt_no_ignore/expected_component_sbom.json
test/providers/tst_manifests/pip/pip_requirements_virtual_env_txt_no_ignore/expected_stack_sbom.json
test/providers/tst_manifests/pip/pip_requirements_virtual_env_with_ignore/requirements.txt
test/providers/tst_manifests/pip/pip_requirements_virtual_env_with_ignore/expected_component_sbom.json
test/providers/tst_manifests/pip/pip_requirements_virtual_env_with_ignore/expected_stack_sbom.json
test/providers/tst_manifests/pyproject/poetry_only_deps/expected_stack_sbom.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

sourcery-ai[bot]
sourcery-ai Bot previously approved these changes Oct 29, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

pipdeptree 4.x transitively requires typing_extensions>=4.16, which
upgrades whatever the user has pinned and triggers version-mismatch
errors. pipdeptree 2.x has no such transitive deps.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
sourcery-ai[bot]
sourcery-ai Bot previously approved these changes Oct 29, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourcery assessment

Approved.

@codecov-commenter

codecov-commenter commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.03%. Comparing base (235595c) to head (34c549d).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #683      +/-   ##
==========================================
+ Coverage   92.02%   92.03%   +0.01%     
==========================================
  Files          43       43              
  Lines       11284    11305      +21     
  Branches     2258     2265       +7     
==========================================
+ Hits        10384    10405      +21     
  Misses        900      900              
Flag Coverage Δ
unit-tests 92.03% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/providers/python_controller.js 86.93% <100.00%> (+0.02%) ⬆️
src/providers/python_poetry.js 97.53% <100.00%> (+0.16%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ruromero ruromero left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for unblocking CI! The Python 3.13 bump and the immutables 0.20 → 0.21 change look right (0.20 has no cp313 wheels). A few things need addressing before merge:

Blocking

  1. poetry_only_deps snapshot now encodes a parser bug. The new expected output has flask → zipp as a direct dependency, which is wrong. Flask doesn't depend on zipp. Root cause is in src/providers/python_poetry.js (~L271-277): when a child's marker evaluates false we continue before pushing it onto stack, so its own children (zipp at depth 2) get attached to the grandparent. zipp carries the same python_version < "3.10" marker in poetry.lock, so it should be dropped as well. This was latent while CI ran on 3.9. Please fix the parser (e.g. track skipped subtrees by depth) and regenerate the fixture rather than snapshotting the current output. See inline comment.

  2. pipdeptree pin rationale doesn't hold up. Per PyPI metadata:

    • pipdeptree 2.35.3 (what <3 resolves to on Python ≥3.10) → packaging>=26
    • pipdeptree 3.0.0 → packaging>=26, tomli>=2; python_version < "3.11"
    • pipdeptree 4.0.0 → nab-index, nab-python (the typing_extensions source)

    So the commit message's "pipdeptree 2.x has no such transitive deps" isn't accurate: <3 still upgrades the user's packaging, and excluding 3.x buys essentially nothing over <4. The PR summary ("constrain to the 3.x release line") also contradicts the code. Suggest pipdeptree<4 with an accurate comment, or longer term avoid installing into the user's environment at all.

  3. DCO sign-off missing on both commits (CONTRIBUTING.md: "Commits must be signed-off"; CONVENTIONS.md: "DCO required"). 76d74e0 only has a Co-Authored-By trailer.

Non-blocking

  • The pipdeptree pin is a user-facing runtime change, but the PR is titled chore:. If squashed, it won't appear as a fix in release notes. Consider retitling or splitting it into its own PR, since the CI bump doesn't depend on it.
  • async-timeout disappears from the pip_requirements_txt_ignore fixtures because of python_full_version < '3.11', not the < "3.10" markers mentioned in the description.
  • Pip/poetry fixtures now only pass on Python ≥3.11 locally. Might be worth a note for contributors.
  • The README "Using pipdeptree" section could mention the version constraint, since we install it into the user's environment.

Comment thread src/providers/python_controller.js Outdated
Comment thread test/providers/tst_manifests/pyproject/poetry_only_deps/expected_stack_sbom.json Outdated
pipdeptree 4.x depends on nab-* packages that pull
typing_extensions>=4.16, polluting the user's env and causing
version-mismatch errors. 2.x and 3.x have no such transitive deps.

Fix a latent bug in the poetry tree parser where marker-excluded deps
had their children re-parented onto the grandparent. Now tracks
skipDepth to skip entire subtrees, and checks package-level markers
from poetry.lock in addition to dependency-edge markers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Noah Santschi-Cooney <noah@santschi-cooney.ch>

@ruromero ruromero left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Strum355
Strum355 merged commit b91037c into main Oct 29, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants