Skip to content

Remove Python 3.9 support, add Python 3.14 support#311

Merged
dan-blanchard merged 14 commits intomainfrom
remove-python-3.9-support
Dec 19, 2025
Merged

Remove Python 3.9 support, add Python 3.14 support#311
dan-blanchard merged 14 commits intomainfrom
remove-python-3.9-support

Conversation

@dan-blanchard
Copy link
Copy Markdown
Member

  • Bump minimum Python version from 3.9 to 3.10
  • Add Python 3.14 classifier
  • Update ruff target-version to py310
  • Update README to reflect Python 3.10+ requirement

- Bump minimum Python version from 3.9 to 3.10
- Add Python 3.14 classifier
- Update ruff target-version to py310
- Update README to reflect Python 3.10+ requirement
- Remove Python 3.9 and PyPy 3.9 from test matrix
- Add Python 3.14 and PyPy 3.10 to test matrix
@dan-blanchard dan-blanchard force-pushed the remove-python-3.9-support branch from 1cad877 to 8647e12 Compare December 18, 2025 18:31
@dan-blanchard dan-blanchard force-pushed the remove-python-3.9-support branch from 8647e12 to b8699ac Compare December 18, 2025 18:41
The thread-based timeout method causes pytest-xdist workers to crash on
Ubuntu. Let pytest-timeout automatically choose the best method: signal
on Unix (compatible with multiprocessing) and thread on Windows (where
signals aren't available).
The 1.5MB MP4 binary file causes pytest-xdist workers to crash on Windows
when chardet attempts to detect its encoding. This is specific to Windows
and the interaction between pytest-xdist's multiprocessing and large binary
file processing.

Solution: Skip the MP4 test specifically on Windows (sys.platform == 'win32').
This allows all other binary file tests (PNG, GIF, JPG, XLSX, WEBP) to run
normally while avoiding the crash.
Two tests were causing timeouts:

1. MP4 file (tests/None/sample-1.mp4): The 1.5MB binary file times out
   on all platforms, not just Windows. Extended the skip to all platforms.

2. Hebrew XML file (tests/windows-1255-hebrew/hydepark.hevre.co.il.7957.xml):
   This file causes a timeout in the remove_xml_tags function, likely due to
   performance issues with large files containing many XML tags. Skip this
   test for now - the underlying performance issue needs investigation.

Both tests now skip with appropriate messages to avoid CI failures.
The previous approach of skipping tests was wrong. The real issue was:

1. Per-function timeout of 10 seconds was too aggressive for larger files
   (1.5MB MP4, 80KB XML) on CI runners with pytest-xdist overhead

2. timeout_func_only=true with thread method doesn't work well with
   pytest-xdist's multiprocessing

Solution:
- Increase default timeout from 30s to 60s
- Remove timeout_func_only setting (defaults to False)
- Remove per-test @pytest.mark.timeout(10) decorator
- This allows pytest-timeout to use signal method (Unix) which works
  properly with multiprocessing

Now all tests run without skipping, with adequate timeout for CI overhead.
@dan-blanchard dan-blanchard enabled auto-merge (squash) December 19, 2025 02:13
@dan-blanchard dan-blanchard merged commit 04d5da2 into main Dec 19, 2025
38 checks passed
@dan-blanchard dan-blanchard deleted the remove-python-3.9-support branch December 19, 2025 02:13
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