Skip to content

test: Handle Python 3.15 warning coming from transitive dependency pygments#9910

Merged
edgarrmondragon merged 1 commit into
mainfrom
ci/handle-py315-warning
Mar 20, 2026
Merged

test: Handle Python 3.15 warning coming from transitive dependency pygments#9910
edgarrmondragon merged 1 commit into
mainfrom
ci/handle-py315-warning

Conversation

@edgarrmondragon

@edgarrmondragon edgarrmondragon commented Mar 20, 2026

Copy link
Copy Markdown
Collaborator

Description

SSIA.

Checklist

Was generative AI tooling used to co-author this PR?

  • Yes (please specify the tool below)

Related Issues

Summary by Sourcery

Adjust test configuration to handle a new Python 3.15 deprecation warning from pygments and scope a Pyo3 compatibility flag to nox-managed environments.

Build:

  • Add a pytest warning filter in pyproject.toml to ignore the pygments DeprecationWarning about os.path.commonprefix on Python 3.15.

CI:

  • Remove the global PYO3_USE_ABI3_FORWARD_COMPATIBILITY environment variable from the GitHub Actions test workflow and rely on environment configuration within nox sessions instead.

Tests:

  • Set PYO3_USE_ABI3_FORWARD_COMPATIBILITY within the nox _uv_sync session environment so that test environments retain the required Pyo3 ABI compatibility setting.

…gments

- pygments/pygments#3039

Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com>
@edgarrmondragon edgarrmondragon self-assigned this Mar 20, 2026
@netlify

netlify Bot commented Mar 20, 2026

Copy link
Copy Markdown

Deploy Preview for meltano canceled.

Name Link
🔨 Latest commit a71d2f6
🔍 Latest deploy log https://app.netlify.com/projects/meltano/deploys/69bd8dcc85fe45000897f3b3

@sourcery-ai

sourcery-ai Bot commented Mar 20, 2026

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

Reviewer's Guide

Scopes the PyO3 ABI3 compatibility environment variable to the nox uv sync session instead of the global CI environment, and adds a pytest warning filter to suppress a new DeprecationWarning emitted by pygments under Python 3.15.

Sequence diagram for pytest handling pygments DeprecationWarning

sequenceDiagram
  actor Dev as Developer
  participant Pytest as pytest
  participant Tests as Test_suite
  participant Pygments as pygments

  Dev->>Pytest: run tests
  Pytest->>Tests: execute tests
  Tests->>Pygments: use highlighting utilities
  Pygments-->>Pytest: emit DeprecationWarning
  Pytest->>Pytest: apply filterwarnings
  Pytest-->>Dev: report test results without DeprecationWarning
Loading

File-Level Changes

Change Details Files
Stop setting PYO3_USE_ABI3_FORWARD_COMPATIBILITY as a global environment variable in the GitHub Actions test workflow.
  • Remove PYO3_USE_ABI3_FORWARD_COMPATIBILITY from the workflow-level env block so it is no longer exported globally during CI test runs
.github/workflows/test.yml
Set PYO3_USE_ABI3_FORWARD_COMPATIBILITY only within the nox uv sync session environment.
  • Extend the env dict in _uv_sync to include PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 so the flag is applied when nox creates/syncs the virtualenv via uv
noxfile.py
Silence the pygments os.path.commonprefix deprecation warning in pytest runs.
  • Add a filterwarnings entry that marks the specific os.path.commonprefix DeprecationWarning from pygments as 'once' to keep test output clean under Python 3.15
pyproject.toml

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

@edgarrmondragon edgarrmondragon marked this pull request as ready for review March 20, 2026 18:18
@edgarrmondragon edgarrmondragon requested a review from a team as a code owner March 20, 2026 18:18

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The new filterwarnings entry hard-codes the full deprecation message string, which may change across Python versions; consider matching only on the warning category and module (e.g., via module or a shorter regex) to make the filter more robust.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new filterwarnings entry hard-codes the full deprecation message string, which may change across Python versions; consider matching only on the warning category and module (e.g., via `module` or a shorter regex) to make the filter more robust.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@edgarrmondragon edgarrmondragon added this pull request to the merge queue Mar 20, 2026
Merged via the queue into main with commit f402bc2 Mar 20, 2026
59 checks passed
@edgarrmondragon edgarrmondragon deleted the ci/handle-py315-warning branch March 20, 2026 18:21
@codecov

codecov Bot commented Mar 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.48%. Comparing base (7c0c77b) to head (a71d2f6).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9910   +/-   ##
=======================================
  Coverage   96.48%   96.48%           
=======================================
  Files         285      285           
  Lines       24739    24739           
  Branches     1417     1417           
=======================================
  Hits        23869    23869           
  Misses        697      697           
  Partials      173      173           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant