Skip to content

#12642 Remove 3.9 and promote 3.14 and 3.15 - #12643

Merged
adiroiban merged 15 commits into
trunkfrom
12642-remove-python-3.9
May 22, 2026
Merged

adiroiban merged 15 commits into
trunkfrom
12642-remove-python-3.9

Conversation

@adiroiban

@adiroiban adiroiban commented May 11, 2026 •

Copy link
Copy Markdown
Member

Scope and purpose

Fixes #12642
Fixes #12430

This updates GitHub Actions and prepare for a future release where Python 3.9 is no longer supported.

  • It also enabled all Python 3.14 as it looks like all issues were fixed.

  • It also enables a few Python 3.15 tests to help adding support for 3.15

  • It uses a new release of the test helper... which is waiting a review here Release 26.4.1 cython-test-exception-raiser#20

  • Run tests on Ubuntu 24.04 (from 22.04) by default... I expect that Ubuntu 22.04 will be removed at some time and I 24.04 was required for GTK tests.

  • Separate sphinx + pydoctor deps, and don't install them on all dev enviromnents. Most devs don't build the docs... pydoctor apidocs take a very long time to build...and some sphinx extensions are not yet available on Python 3.15

  • Enable all Python 3.14 tests

  • Enable some Python 3.15 tests ... trial tests are skipped and will be fixed in #12645 Fix Python 3.15 compatibility issues in trial #12602

@codspeed

codspeed Bot commented May 11, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 36 untouched benchmarks


Comparing 12642-remove-python-3.9 (5941b89) with trunk (28c4003)

Open in CodSpeed

@adiroiban adiroiban changed the title #12642 Remove 3.9 and promote 3.14. #12642 Remove 3.9 and promote 3.14 and 3.15 May 11, 2026
@gudnimg

gudnimg commented May 12, 2026

Copy link
Copy Markdown
Contributor

Should we also remove these conditions which are now always true? python_version >= '3.10'"

"pyobjc-core >= 12 ; python_version >= '3.10'",

gtk-platform = [
    "twisted[all-non-platform]",
    "pygobject; python_version >= '3.10'",
    "pygobject < 3.52.1; python_version < '3.10'",
]

Can be:

gtk-platform = [
    "twisted[all-non-platform]",
    "pygobject",
]

@gudnimg

gudnimg commented May 12, 2026 •

Copy link
Copy Markdown
Contributor

Also perhaps update the [tool.black] section too

 [tool.black]
-target-version = ['py39', 'py310', 'py311', 'py312']
+target-version = ['py310', 'py311', 'py312', 'py313']

@adiroiban

Copy link
Copy Markdown
Member Author

@gudnimg thanks

Should we also remove these conditions which are now always true? python_version >= '3.10'"

Yes. All of that.

Feel free to leave inline comments or push your changes to this branch.


This is still WIP ... I am also trying to see where we stand with Python 3.14 and 3.15 ... and pushing various changes between meetings at work

@adiroiban

Copy link
Copy Markdown
Member Author

I will apply the current chagnes mentioned by you... no need to re-add them

@gudnimg

gudnimg commented May 12, 2026

Copy link
Copy Markdown
Contributor

I will apply the current chagnes mentioned by you... no need to re-add them

If you need any help, I'll be able to do some work over the weekend :) My Linux machine at home has now Ubuntu 26.04 and it ships with Python 3.14. I also have Windows 11 with Python 3.14. No MacOS though.

@adiroiban

Copy link
Copy Markdown
Member Author

Thanks. A review would help a lot.

Python 3.14 should be ok... all looks good.

I am not checking 3.15...

I see that GitHub has 3.15 beta... but on my uv I only have 3.15.0a8

On my local env the only test that fails is:

trial twisted.trial.test.test_doctest

@adiroiban

Copy link
Copy Markdown
Member Author

@gudnimg thanks for your feedback.

py313 is not yet supported by the current black version that we use.

But I think that it would be nice to move to ruff - #12646


This should be ready for a review

needs-review

@chevah-robot
chevah-robot requested a review from a team May 12, 2026 10:53

@gudnimg gudnimg 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.

One minor comment. Besides that the pull request looks good to me. 👍

Comment thread pyproject.toml Outdated

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.

Shouldn't this be raised to Python 3.10? Otherwise this will allow users to build the package for Python 3.9

Comment thread pyproject.toml Resolved
Comment thread pyproject.toml Outdated
license = { text = "MIT License" }
# When updating this value, make sure our CI matrix includes a matching minimum version.
requires-python = ">=3.9.12"
requires-python = ">=3.10.20"

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.

Suggested change
requires-python = ">=3.10.20"
requires-python = ">=3.10"

Hmm I wonder, is Python 3.10.20 not available on Windows?

image

I don't see any executable/installer https://www.python.org/downloads/release/python-31020/

But I see it for Python 3.10.11 https://www.python.org/downloads/release/python-31011/


Instead of specifying the minor version, can the toml file just say ">= 3.10"?

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.

Seems strange to me to put a requirement on the minor version without good reason.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There was an error. I have fixed it.
In the past, GitHub Python action didn't had all micro-releases...so we were requiring the oldes micro-release available.

The idea was that since we don't test on older micro-releases, it's hard to guarante that it will work.

@adiroiban adiroiban mentioned this pull request May 22, 2026

@glyph glyph left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Assuming CI is happy, looks good. None of the feedback is blocking.

Comment thread .github/workflows/test.yaml Resolved
Comment thread .github/workflows/test.yaml Outdated
# that is support by GitHub Actions for the target OS.
# This is also used to run tests with minimum dependency versions.
- python-version: '3.9'
- python-version: '3.10.4'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In principle I guess we should be pinning the micro-version here so we don't get any surprises. But it worries me that we don't have any way to have this upgraded automatically for security fixes, and also why are we going with an old/unsupported version rather than the current (3.10.20)?

if: always() # Always run the coverage report, even when the tests fail.
# Always run the coverage report, even when the tests fail.
# As long as the job is not cancelled.
if: ${{ !cancelled() }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

# Is very important to force running this always, as otherwise it will be
# skipped by default.
if: always()
if: ${{ !cancelled() }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just curious, why is the previous version bare but this version is in {{ }}?

Comment thread pyproject.toml
Comment on lines +113 to +115
"pyobjc-core >= 12",
"pyobjc-framework-CFNetwork >= 12",
"pyobjc-framework-Cocoa >= 12",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

Comment thread pyproject.toml Resolved
@glyph

glyph commented May 22, 2026

Copy link
Copy Markdown
Member

py313 is not yet supported by the current black version that we use.

Oh, I see. Separate PR to upgrade 'black' then. Jeez do we ever need dependabot.

@adiroiban

Copy link
Copy Markdown
Member Author

Thanks for the review.

Oh, I see. Separate PR to upgrade 'black' then. Jeez do we ever need dependabot.

For black a separate PR is better since it might generate formatting changes.

I don't think that we need dependabot... I think that dependabot is useful for end user applications... but for libraries, it's ok to keep support for older dependencies.

now... we might want to keep the dev tools up to date ... so maybe yes. we can enable dependbot to trigger updates for the dev tools, once every 3 months or so


Just curious, why is the previous version bare but this version is in {{ }}?

Maybe the "bare" version would also work... but I remember there were some issues with the exclamation mark...

Comment thread .github/workflows/test.yaml Resolved
Co-authored-by: Glyph <[email protected]>
Co-authored-by: Adi Roiban <[email protected]>
@adiroiban
adiroiban merged commit 9d1e48d into trunk May 22, 2026
26 checks passed
@adiroiban
adiroiban deleted the 12642-remove-python-3.9 branch May 22, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove GHA for Python 3.9 ☂️ Add support for Python 3.14

4 participants