Skip to content

docs: update readme to the new SDL versions of ubuntu jammy with python 3.10#3795

Open
pxlman wants to merge 2 commits into
pygame-community:mainfrom
pxlman:main
Open

docs: update readme to the new SDL versions of ubuntu jammy with python 3.10#3795
pxlman wants to merge 2 commits into
pygame-community:mainfrom
pxlman:main

Conversation

@pxlman
Copy link
Copy Markdown

@pxlman pxlman commented May 10, 2026

Closes #3794

Updates the documented minimum SDL dependency versions to align with Ubuntu Jammy (22.04), which is the oldest supported distro that ships with Python 3.10 — the new minimum since we dropped Python 3.9 / Debian Bullseye support.

Changes

  • README.rst: bump minimum SDL from 2.0.14 → 2.20.0, SDL_image from 2.0.4 → 2.0.5, SDL_ttf from 2.0.15 → 2.0.18 (SDL_mixer unchanged at 2.0.4)
  • docs/reST/ref/event.rst: update WINDOWICCPROFCHANGED and WINDOWDISPLAYCHANGED SDL backend version notes from 2.0.18 → 2.0.20, reflecting the actual minimum SDL version at which those events became available

@pxlman pxlman requested a review from a team as a code owner May 10, 2026 21:04
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 10, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0821b09a-5f85-46b2-992e-e54eb1f58bf0

📥 Commits

Reviewing files that changed from the base of the PR and between afac13f and df90cb8.

📒 Files selected for processing (1)
  • README.rst
✅ Files skipped from review due to trivial changes (1)
  • README.rst

📝 Walkthrough

Walkthrough

Raised declared minimum SDL to >= 2.0.20, SDL_image to >= 2.0.5, and SDL_ttf to >= 2.0.18 in the README; updated WINDOWDISPLAYCHANGED event docs to require SDL backend >= 2.0.20.

Changes

SDL Dependency Version Updates

Layer / File(s) Summary
README Dependency Table
README.rst
Minimum SDL raised to >= 2.0.20, SDL_image to >= 2.0.5, SDL_ttf to >= 2.0.18; SDL_mixer remains >= 2.0.4.
Event Documentation Alignment
docs/reST/ref/event.rst
WINDOWDISPLAYCHANGED event SDL backend requirement updated from >= 2.0.18 to >= 2.0.20; display_index attribute unchanged.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested labels

docs, event

Suggested reviewers

  • Starbuck5
  • ankith26
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: updating SDL version documentation to align with Ubuntu Jammy and Python 3.10.
Description check ✅ Passed The description clearly explains the rationale (Ubuntu Jammy with Python 3.10) and lists all specific version updates made in both files.
Linked Issues check ✅ Passed The PR fulfills issue #3794 requirements: README.rst versions match Jammy packages (SDL 2.20.0, SDL_mixer 2.0.4, SDL_image 2.0.5, SDL_ttf 2.0.18) and event.rst backend version notes updated to 2.0.20.
Out of Scope Changes check ✅ Passed All changes are in-scope: README.rst dependency version table and docs/reST/ref/event.rst backend notes, directly addressing issue #3794 objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/reST/ref/event.rst`:
- Around line 192-194: The SDL version string is inconsistent between the docs:
event.rst documents the SDL backend as ">= 2.0.20" while README.rst uses ">=
2.20.0"; determine the correct SDL version (likely the SDL 2.0.x format, e.g.,
2.0.20 for Jammy compatibility) and make both places consistent by updating the
SDL backend version string wherever it appears (the occurrence near the
WINDOWDISPLAYCHANGED entry and the README.rst SDL minimum-version mention) so
they use the same, correct version format.

In `@README.rst`:
- Line 128: Update the SDL version requirement string in the README entry that
currently reads ">= 2.20.0" to the correct semantic version ">= 2.0.20"; locate
the table row for the "SDL" entry in README.rst (the line containing "SDL      |
>= 2.20.0") and change the version token to match the rest of the project (tuple
(2, 0, 20) and event.rst), ensuring the formatted table aligns after the edit.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b07a3b82-8327-40ea-b515-e0e74e7d77e3

📥 Commits

Reviewing files that changed from the base of the PR and between 51ab3d7 and afac13f.

📒 Files selected for processing (2)
  • README.rst
  • docs/reST/ref/event.rst

Comment thread docs/reST/ref/event.rst
Comment thread README.rst Outdated
@oddbookworm
Copy link
Copy Markdown
Member

Ok, so I appreciate the quickness of getting this pull request open, but I'm going to have to lay out some blockers for it:

  1. The issue opened by @Starbuck5 had a typo, and the minimum SDL version supported by Jammy is not 2.20.0, it's 2.0.20 (the link posted does list the correct version in ubuntu's package repo)
  2. I doubt that there are no locations at all in the codebase that we can remove preprocessor conditions with this version raise, so please check the C source for anywhere we require a minimum SDL version that is now at or below the minimum version (not just SDL, but all of the SDL helpers)

@pxlman
Copy link
Copy Markdown
Author

pxlman commented May 10, 2026

The issue opened by @Starbuck5 had a typo, and the minimum SDL version supported by Jammy is not 2.20.0, it's 2.0.20 (the link posted does list the correct version in ubuntu's package repo)

@oddbookworm thanks for fast replying, i realized this and pushed a new modification
now i will check the second part

@oddbookworm
Copy link
Copy Markdown
Member

Here's an example of what I mean, from event.c

#if SDL_VERSION_ATLEAST(3, 0, 0)
            _pg_insobj(dict, "precise_x",
                       PyFloat_FromDouble((double)event->wheel.x));
            _pg_insobj(dict, "precise_y",
                       PyFloat_FromDouble((double)event->wheel.y));
#elif SDL_VERSION_ATLEAST(2, 0, 18)
            _pg_insobj(dict, "precise_x",
                       PyFloat_FromDouble((double)event->wheel.preciseX));
            _pg_insobj(dict, "precise_y",
                       PyFloat_FromDouble((double)event->wheel.preciseY));

#else /* ~SDL_VERSION_ATLEAST(2, 0, 18) */
        /* fallback to regular x and y when SDL version used does not
         * support precise fields */
        _pg_insobj(dict, "precise_x",
                   PyFloat_FromDouble((double)event->wheel.x));
        _pg_insobj(dict, "precise_y",
                   PyFloat_FromDouble((double)event->wheel.y));

#endif /* ~SDL_VERSION_ATLEAST(2, 0, 18) */

With the SDL version now being at least 2.0.20, that last block can be removed and the elif can be converted to an else because now the 2.0.18 minimum is guaranteed to be met

@pxlman
Copy link
Copy Markdown
Author

pxlman commented May 10, 2026

@oddbookworm
so should it be like this?

#if SDL_VERSION_ATLEAST(3, 0, 0)
            _pg_insobj(dict, "precise_x",
                       PyFloat_FromDouble((double)event->wheel.x));
            _pg_insobj(dict, "precise_y",
                       PyFloat_FromDouble((double)event->wheel.y));
#else /* SDL_VERSION_ATLEAST(2, 0, 20) */
            _pg_insobj(dict, "precise_x",
                       PyFloat_FromDouble((double)event->wheel.preciseX));
            _pg_insobj(dict, "precise_y",
                       PyFloat_FromDouble((double)event->wheel.preciseY));

#endif

@Starbuck5
Copy link
Copy Markdown
Member

The comment after the else is confusing. The convention is for the comment to remind what the if statement is saying, e.g. "else not THIS," but you're just using it to assert some global thing about the minimum SDL version. The comment could be removed or it could follow the convention.

@oddbookworm
Copy link
Copy Markdown
Member

To piggyback off of what Starbuck5 said, I would expect either this

#if SDL_VERSION_ATLEAST(3, 0, 0)
            _pg_insobj(dict, "precise_x",
                       PyFloat_FromDouble((double)event->wheel.x));
            _pg_insobj(dict, "precise_y",
                       PyFloat_FromDouble((double)event->wheel.y));
#else
            _pg_insobj(dict, "precise_x",
                       PyFloat_FromDouble((double)event->wheel.preciseX));
            _pg_insobj(dict, "precise_y",
                       PyFloat_FromDouble((double)event->wheel.preciseY));

#endif

Or this

#if SDL_VERSION_ATLEAST(3, 0, 0)
            _pg_insobj(dict, "precise_x",
                       PyFloat_FromDouble((double)event->wheel.x));
            _pg_insobj(dict, "precise_y",
                       PyFloat_FromDouble((double)event->wheel.y));
#else /* ~SDL_VERSION_ATLEAST(3, 0, 0) */
            _pg_insobj(dict, "precise_x",
                       PyFloat_FromDouble((double)event->wheel.preciseX));
            _pg_insobj(dict, "precise_y",
                       PyFloat_FromDouble((double)event->wheel.preciseY));

#endif

@aatle aatle added the docs label May 12, 2026
Copy link
Copy Markdown
Member

@oddbookworm oddbookworm left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for addressing the comments left! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Raise minimum SDL dependency versions

4 participants