Skip to content

Raise stated minimum Python version to 3.10 - #677

Open
curufinwe wants to merge 1 commit into
mainfrom
raise-python-target
Open

curufinwe wants to merge 1 commit into
mainfrom
raise-python-target

Conversation

@curufinwe

Copy link
Copy Markdown
Contributor

pyproject.toml sets ruff's target-version = "py38". That is the only place in the repository that states a Python version: there is no requires-python, setup.py or setup.cfg, and README, CONTRIBUTING and docs/ don't mention one. But neither the CI nor the code matches it:

  • CI tests 3.10 only. tests.yml and hashes.yml run on Python 3.10.12. (ruff.yml uses 3.13 to install ruff; apptek_hashes.yml sets up 3.8 but runs only curl/jq to start the Bitbucket pipeline, so its Python version doesn't matter.)
  • Code on main already needs 3.10. lib/asr_results.py (Add library for reading/writing new ASR result format #633) has a match statement, which is a SyntaxError before 3.10, and uses str | PathLike and list[...] annotations without from __future__ import annotations. text/csv.py (Add job to get columns from csv file #643) uses an unguarded list[int] annotation, which needs 3.9.

This PR changes the ruff target to py310, so the stated version matches what is tested and what the code already requires. For consistency, it also sets apptek_hashes.yml to 3.10.12 like the other workflows. That workflow doesn't run Python, so nothing changes in what it does.

Formatting. With target-version = "py310", ruff 0.11.8 (the version CI pins) formats multi-item with statements using parenthesized context managers, a 3.10 feature. Six files are rewritten this way: corpus/filter.py, corpus/segments.py, fairseq/manifest.py, lexicon/conversion.py, lm/vocabulary.py and text/info.py. The changes are layout only and live inside run() bodies, so no behaviour, constructor argument or job hash changes. Without them, the ruff check would fail on this PR.

— Claude Code

🤖 Generated with Claude Code

ruff's target-version said py38, but CI tests only 3.10 and main already
needs 3.10 (match statement in lib/asr_results.py). Raise it to py310 and
apply the resulting ruff 0.11.8 formatting (parenthesized multi-item with
statements; layout only). Also set apptek_hashes.yml to 3.10.12 for
consistency with the other workflows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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