Skip to content

Add Python 3.13 support#474

Merged
JoelNiklaus merged 3 commits intohuggingface:mainfrom
JoelNiklaus:feat/python-3.13-3.14-support
Mar 16, 2026
Merged

Add Python 3.13 support#474
JoelNiklaus merged 3 commits intohuggingface:mainfrom
JoelNiklaus:feat/python-3.13-3.14-support

Conversation

@JoelNiklaus
Copy link
Copy Markdown
Contributor

@JoelNiklaus JoelNiklaus commented Mar 16, 2026

Problem

Datatrove only declares and tests support for Python 3.10, 3.11, and 3.12, even though Python 3.13 (Oct 2024) is in active maintenance. Users on newer Python versions see missing classifiers on PyPI and have no CI coverage guaranteeing compatibility.

Solution

  • Add Programming Language :: Python :: 3.13 classifier to pyproject.toml.
  • Extend the CI test matrix in .github/workflows/testing.yml to include 3.13.
  • Modernize type annotations across 11 files: replace deprecated typing.Optional, typing.List, typing.Dict, typing.Tuple, and typing.Union with built-in generics (X | None, list, dict, tuple, X | Y) and collections.abc (Callable, Sequence). The project already targets >=3.10, so these are all safe.
  • Add "Requires Python 3.10+." note to the README installation section.

Notes

Python 3.14 is not included yet because key optional dependencies (tensorflow, vllm) don't ship cp314 wheels. Since requires-python = ">=3.10.0" already permits 3.14 installs, users can still install and use datatrove on 3.14 -- we just don't test it in CI yet.

Testing

  • All 347 tests pass on Python 3.12 (current venv).
  • Ruff linting and formatting checks pass across all modified files.
  • Full CI validation on 3.13 will run when this PR is opened.

Joel Niklaus added 3 commits March 16, 2026 03:21
- Add 3.13/3.14 classifiers to pyproject.toml
- Extend CI test matrix to include 3.13 and 3.14
- Modernize type annotations: replace typing.Optional/List/Dict/Tuple/Union
  with built-in generics across 11 files
- Add Python version requirement to README

Made-with: Cursor
tensorflow and vllm don't ship cp314 wheels yet, which breaks
`pip install .[testing]` on Python 3.14. Install a reduced set of
extras on 3.14 while keeping full coverage on 3.10-3.13.

Made-with: Cursor
Key optional deps (tensorflow, vllm) lack cp314 wheels. Keep only
3.13 for now; 3.14 can be added once the ecosystem catches up.

Made-with: Cursor
@JoelNiklaus JoelNiklaus changed the title Add Python 3.13 and 3.14 support Add Python 3.13 support Mar 16, 2026
@JoelNiklaus JoelNiklaus merged commit c0daa4a into huggingface:main Mar 16, 2026
5 checks passed
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