Skip to content

Switch to windows-2022 build server and winrt #1217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 1, 2025
Merged

Conversation

aw-was-here
Copy link
Collaborator

@aw-was-here aw-was-here commented Jul 1, 2025

Summary by Sourcery

Update continuous integration to Python 3.12 and modern Windows runners, enforce Python version bounds, and migrate Windows media control imports to the WinRT API.

Enhancements:

  • Replace winsdk imports with winrt for Windows media control

Build:

  • Add requires-python constraint >=3.11,<3.13 in pyproject.toml

CI:

  • Use Python 3.12 in GitHub Actions workflows
  • Switch Windows jobs to windows-2022 runner

Copy link

sourcery-ai bot commented Jul 1, 2025

Reviewer's Guide

This PR migrates the Windows input module to use the winrt package, upgrades Windows CI runners to windows-2022, bumps testing and build workflows to Python 3.12, and locks project compatibility to ≥3.11,<3.13.

Class diagram for winmedia.py Windows media imports migration

classDiagram
    class winmedia
    class MediaManager
    class DataReader
    class Buffer
    class InputStreamOptions
    winmedia ..> MediaManager : uses
    winmedia ..> DataReader : uses
    winmedia ..> Buffer : uses
    winmedia ..> InputStreamOptions : uses
    note for winmedia "Imports now from winrt.windows.* instead of winsdk.windows.*"
Loading

File-Level Changes

Change Details Files
Upgrade CI workflows to Python 3.12 and windows-2022 runners
  • Bump setup-python versions from 3.11 to 3.12 across testing and PyInstaller workflows
  • Switch runs-on from windows-2019 to windows-2022 for Windows jobs
  • Update test matrix to include Python 3.12 instead of 3.10
.github/workflows/testing.yaml
.github/workflows/pyinstaller.yaml
Migrate Windows media input imports to winrt
  • Replace imports from winsdk.windows.* with winrt.windows.*
  • Import GlobalSystemMediaTransportControlsSessionManager as MediaManager via winrt
  • Switch DataReader, Buffer, InputStreamOptions imports to winrt equivalents
nowplaying/inputs/winmedia.py
Constrain supported Python versions in project metadata
  • Add requires-python = ">=3.11,<3.13" to pyproject.toml
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

Copy link

codecov bot commented Jul 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.25%. Comparing base (7d07f9e) to head (84ae16d).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1217   +/-   ##
=======================================
  Coverage   68.25%   68.25%           
=======================================
  Files          63       63           
  Lines       10969    10969           
=======================================
  Hits         7487     7487           
  Misses       3482     3482           
Flag Coverage Δ
unittests 68.25% <100.00%> (ø)

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

Files with missing lines Coverage Δ
nowplaying/inputs/winmedia.py 42.35% <100.00%> (ø)

... and 2 files with indirect coverage changes

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

@aw-was-here aw-was-here marked this pull request as ready for review July 1, 2025 18:47
@aw-was-here aw-was-here merged commit 065b0a9 into main Jul 1, 2025
15 checks passed
@aw-was-here aw-was-here deleted the windows_updates branch July 1, 2025 18:47
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @aw-was-here - I've reviewed your changes - here's some feedback:

  • Ensure the winrt package is added to your runtime dependencies so those new imports won’t break in CI or production.
  • Consider extracting the repeated Python setup steps across your workflows into a reusable action to reduce duplication.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Ensure the winrt package is added to your runtime dependencies so those new imports won’t break in CI or production.
- Consider extracting the repeated Python setup steps across your workflows into a reusable action to reduce duplication.

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.

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