Repository navigation
Drop Python 3.9 support - #1597
Open
MankhongGarden wants to merge 2 commits into
Open
MankhongGarden wants to merge 2 commits into
MankhongGarden wants to merge 2 commits into
Conversation
Python 3.9 reached end of life in October 2025, and the ubuntu-latest (26.04) runner no longer provides it, so the 3.9 jobs fail. - Set requires-python to >=3.10 and remove the 3.9 classifier - Make Python 3.10 the earliest version in the test matrix and mypy job - Set the Ruff target to py310 and the mypy target to 3.10 - Remove dev dependency pins that only applied to Python 3.9 - Import Callable from collections.abc (Ruff UP035 with the new target) - Update the README badges, the test matrix table, and the changelog
"3.x" now resolves to Python 3.15, where pip cannot install bandit's PyYAML dependency. Use 3.14, as the other workflows do.
|
bact
approved these changes
Nov 7, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What do these changes do
Drops Python 3.9 support, as agreed in #1592. Python 3.10 is now the earliest supported version. Also runs Bandit on Python 3.14.
What was wrong
devand on every PR.python-version: "3.x", which now resolves to 3.15. There, pip cannot install bandit's PyYAML dependency.How this fixes it
Commit 1, drop Python 3.9:
pyproject.toml:requires-python = ">=3.10", remove the 3.9 classifier, Rufftarget-version = "py310", mypypython_version = "3.10", removepy39from tox, and remove the dev dependency pins that only applied to Python 3.9.unittest.yml: 3.10 replaces 3.9 as the earliest version on all three OSes. The ubuntu-only 3.10 entry is removed, so the matrix still has 9 jobs. PyICU 2.15 stays, because it is also the last Windows wheel for cp310 (2.15.2 and later start at cp311).mypy.yml: Python 3.10.typing.Callable, soCallablenow comes fromcollections.abc. Whereget_type_hints()needs it at runtime (util/time.py,augment/wordnet.py), the import stays at module level with# noqa: TC003, as inutil/strftime.py.tests/README.md, andCHANGELOG.md("The minimum Python version is now 3.10.", as for 3.9 in 5.3.0).pypi-publish.yml. Pitloom's Hatchling build hook may now be usable instead of embedding the SBOM after the build. This PR does not change that; it is your call for a separate change.Commit 2 pins Bandit to Python 3.14, as the lint, corpus, and docs workflows already do.
Testing (Windows 11):
ruff check,ruff format --check,flake8 pythainlp, andmypy pythainlp tests(1.19.1, target 3.10) pass.python -m unittest tests.coreon Python 3.10.22: 752 tests, 71 skipped, 1 error. The error istest_is_within_directory_with_symlinks, becauseos.symlinkneeds extra privileges on Windows. It is unrelated to this change.typing.get_type_hints(pythainlp.util.time)returns the same 7 hints as ondev.Fixes #1592
Your checklist for this pull request