Universal SEO skill for Claude Code. 26 sub-skills + 19 sub-agents covering technical SEO, E-E-A-T, schema, GEO/AEO, agent readiness (Lighthouse Agentic Browsing, WebMCP, llms.txt), backlinks, local SEO, e-commerce, international SEO, Google APIs, and PDF/Excel reporting. 9 optional extensions for live SEO data.
build: require Python 3.11 to 3.14 and pick a supported interpreter
Agrici Daniel0c79ca93faae
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 7a74462..cc2f269 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -16,10 +16,10 @@ jobs:steps:- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1- - name: Set up Python 3.10+ - name: Set up Python 3.11uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0with:- python-version: "3.10"+ python-version: "3.11"- name: Check Python syntaxrun: |@@ -41,7 +41,7 @@ jobs:fail-fast: falsematrix:# The supported floor, a middle release, and the newest release.- python-version: ["3.10", "3.12", "3.14"]+ python-version: ["3.11", "3.12", "3.14"]steps:- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1@@ -63,11 +63,11 @@ jobs:- name: Run pytestenv:- # The live GitHub API tests run on the 3.10 leg only, so the matrix+ # The live GitHub API tests run on the 3.11 leg only, so the matrix# does not triple the calls (the portability job also runs them on# Windows and macOS). gh honors GH_TOKEN, which keeps sync_flow.py# clear of the anonymous 60/hr per-IP rate limit on shared runners.- CLAUDE_SEO_NETWORK_TESTS: ${{ matrix.python-version == '3.10' && '1' || '' }}+ CLAUDE_SEO_NETWORK_TESTS: ${{ matrix.python-version == '3.11' && '1' || '' }}GH_TOKEN: ${{ github.token }}run: pytest tests/ -v@@ -107,10 +107,10 @@ jobs:steps:- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1- - name: Set up Python 3.10+ - name: Set up Python 3.11uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0with:- python-version: "3.10"+ python-version: "3.11"cache: pipcache-dependency-path: requirements.txt@@ -127,15 +127,21 @@ jobs:run: pytest tests/ -vdep-audit:- name: Dependency audit+ # Bounded ranges resolve to different releases per Python (numpy and+ # contourpy differ between 3.11 and 3.14), so audit both ends of the range.+ name: Dependency audit (Python ${{ matrix.python-version }})runs-on: ubuntu-latest+ strategy:+ fail-fast: false+ matrix:+ python-version: ["3.11", "3.14"]steps:- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1- - name: Set up Python 3.10+ - name: Set up Python ${{ matrix.python-version }}uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0with:- python-version: "3.10"+ python-version: ${{ matrix.python-version }}- name: Install pip-auditrun: pip install pip-auditdiff --git a/.github/workflows/v2.yml b/.github/workflows/v2.ymlindex fd0f266..e88631c 100644--- a/.github/workflows/v2.yml+++ b/.github/workflows/v2.yml@@ -29,10 +29,10 @@ jobs:steps:- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1- - name: Set up Python 3.10+ - name: Set up Python 3.11uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0with:- python-version: "3.10"+ python-version: "3.11"- name: Install pytest + test depsrun: pip install pytest beautifulsoup4@@ -46,10 +46,10 @@ jobs:steps:- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1- - name: Set up Python 3.10+ - name: Set up Python 3.11uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0with:- python-version: "3.10"+ python-version: "3.11"- name: Install runtime + test depsrun: |@@ -78,10 +78,10 @@ jobs:steps:- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1- - name: Set up Python 3.10+ - name: Set up Python 3.11uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0with:- python-version: "3.10"+ python-version: "3.11"- name: Install pytest + test deps# Must not be tolerated with `|| true`: several test modules importdiff --git a/.github/workflows/windows-smoke.yml b/.github/workflows/windows-smoke.ymlindex 84393a2..ba3d2f8 100644--- a/.github/workflows/windows-smoke.yml+++ b/.github/workflows/windows-smoke.yml@@ -85,10 +85,18 @@ jobs:if ($failed) { exit 1 }Write-Host "All extension PowerShell scripts parse."- - name: Set up Python 3.10+ - name: Set up Python 3.11+ id: pyuses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0with:- python-version: "3.10"+ python-version: "3.11"++ - name: Pin the installer to setup-python through CLAUDE_SEO_PYTHON+ shell: pwsh+ env:+ PYTHON_PATH: ${{ steps.py.outputs.python-path }}+ run: |+ "CLAUDE_SEO_PYTHON=$env:PYTHON_PATH" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8- name: Prepare isolated user profileshell: pwsh@@ -130,10 +138,20 @@ jobs:$ErrorActionPreference = "Stop"$skillRoot = Join-Path $env:USERPROFILE ".claude\skills\seo"$runtime = Join-Path $skillRoot "scripts\runtime.py"- $doctor = & py -3 $runtime doctor --json+ # Run the runtime with the interpreter the installer chose, read from+ # the venv it built. 'py -3' may be a different, unsupported Python.+ $cfg = Get-Content (Join-Path $skillRoot ".venv\pyvenv.cfg")+ $python = (($cfg | Where-Object { $_ -match '^executable\s*=' }) -split '=', 2)[1].Trim()+ $version = (($cfg | Where-Object { $_ -match '^version\s*=' }) -split '=', 2)[1].Trim()+ if ($version -notmatch '^3\.(1[1-4])\.') { throw "Installer chose unsupported Python $version" }+ if ($env:CLAUDE_SEO_PYTHON -and ((Resolve-Path $python).Path -ne (Resolve-Path $env:CLAUDE_SEO_PYTHON).Path)) {+ throw "Installer ignored CLAUDE_SEO_PYTHON ($python)"+ }+ Write-Host "Installer chose Python $version at $python"+ $doctor = & $python $runtime doctor --jsonif ($LASTEXITCODE -ne 0) { throw "runtime doctor failed" }$doctor | ConvertFrom-Json | Out-Null- $updates = & py -3 $runtime run seo_updates.py --limit 1 --json+ $updates = & $python $runtime run seo_updates.py --limit 1 --jsonif ($LASTEXITCODE -ne 0) { throw "seo_updates failed" }$parsedUpdates = $updates | ConvertFrom-Jsonif ($parsedUpdates.count -ne 1) { throw "Expected one Google update" }@@ -216,10 +234,12 @@ jobs:if ($failed) { exit 1 }Write-Host "All extension PowerShell scripts parse."- - name: Set up Python 3.10+ - name: Set up Python 3.11+ # No CLAUDE_SEO_PYTHON here: the image's 'py -3' may be newer than the+ # supported range, and the installer must fall back on its own.uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0with:- python-version: "3.10"+ python-version: "3.11"- name: Prepare isolated user profileshell: powershell@@ -261,10 +281,20 @@ jobs:$ErrorActionPreference = "Stop"$skillRoot = Join-Path $env:USERPROFILE ".claude\skills\seo"$runtime = Join-Path $skillRoot "scripts\runtime.py"- $doctor = & py -3 $runtime doctor --json+ # Run the runtime with the interpreter the installer chose, read from+ # the venv it built. 'py -3' may be a different, unsupported Python.+ $cfg = Get-Content (Join-Path $skillRoot ".venv\pyvenv.cfg")+ $python = (($cfg | Where-Object { $_ -match '^executable\s*=' }) -split '=', 2)[1].Trim()+ $version = (($cfg | Where-Object { $_ -match '^version\s*=' }) -split '=', 2)[1].Trim()+ if ($version -notmatch '^3\.(1[1-4])\.') { throw "Installer chose unsupported Python $version" }+ if ($env:CLAUDE_SEO_PYTHON -and ((Resolve-Path $python).Path -ne (Resolve-Path $env:CLAUDE_SEO_PYTHON).Path)) {+ throw "Installer ignored CLAUDE_SEO_PYTHON ($python)"+ }+ Write-Host "Installer chose Python $version at $python"+ $doctor = & $python $runtime doctor --jsonif ($LASTEXITCODE -ne 0) { throw "runtime doctor failed" }$doctor | ConvertFrom-Json | Out-Null- $updates = & py -3 $runtime run seo_updates.py --limit 1 --json+ $updates = & $python $runtime run seo_updates.py --limit 1 --jsonif ($LASTEXITCODE -ne 0) { throw "seo_updates failed" }$parsedUpdates = $updates | ConvertFrom-Jsonif ($parsedUpdates.count -ne 1) { throw "Expected one Google update" }diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 8dacc53..9c7dc1e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -11,6 +11,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0Security and accuracy fixes from a full audit, and Claude Desktop installs again.+**Python 3.11 to 3.14 is now required.** Python 3.10 reached end of life on+2026-10-01, and the Pillow 13.0.0 security release (28 advisories, no 12.x+backport) needs 3.11. Python 3.15 is not supported yet because the Google Ads+client library declares `< 3.15`. If your default Python is outside the range,+the launcher and `install.ps1` now pick a supported one on their own, or you+can set `CLAUDE_SEO_PYTHON`; `/seo setup` then rebuilds the runtime once.+### Added- **Server stack CVE exposure check** in `seo-technical` (Security category).@@ -51,8 +58,20 @@ Security and accuracy fixes from a full audit, and Claude Desktop installs againhub and audit skills agree on when the backlinks agent runs, and theextension copies of the DataForSEO and image agents match the core ones,including `model` and `maxTurns`.-- CI runs ruff, tests Python 3.10, 3.12 and 3.14, pins GitHub Actions to- commit SHAs, and no longer exposes `GH_TOKEN` to install steps.+- The supported Python range lives in one place (`MIN_PYTHON` and+ `MAX_PYTHON` in `scripts/runtime.py`), and a test keeps the launcher,+ `install.ps1`, `pyproject.toml`, CI and the docs in step with it.+ `scripts/claude-seo` and `install.ps1` skip a default interpreter outside the+ range (on Windows, `py -3` picks the newest installed Python, which can be+ 3.15) and fall back to the newest supported one, and `install.ps1` now honors+ `CLAUDE_SEO_PYTHON`. `/seo setup` refuses an unsupported interpreter with a+ clear message, and `/seo doctor` reports it.+- `requirements.txt` sets `pillow>=13.0.0` (it arrives through matplotlib and+ WeasyPrint).+- CI runs ruff, tests Python 3.11, 3.12 and 3.14, audits dependencies on both+ 3.11 and 3.14, pins GitHub Actions to commit SHAs, and no longer exposes+ `GH_TOKEN` to install steps. The Windows smoke test covers both a pinned+ `CLAUDE_SEO_PYTHON` and a runner whose default Python is too new.- SECURITY.md and PRIVACY.md describe what the code does, including whichcalls go to fixed vendor hosts and how to verify a signed release tag.@@ -221,8 +240,10 @@ as third-party instead of being stated as fact.- Six reference files over 200 lines were split at section boundaries intosibling files, with no content removed.- Em dashes removed from skills, agents, scripts, extensions and docs.-- Python 3.10 reaches end of life in October 2026; the docs now recommend- 3.11 or newer. The floor is unchanged in this patch.+- `agentic_check.py` rejects a well-known or ARD document nested deeper than+ 256 levels before parsing it. On Python 3.14 the JSON parser's limit follows+ the machine's stack size, so the same hostile document could pass on one+ machine and fail on another.- `google_report.py` PDFs, `lcp_subparts.py` text output and the installerbanners no longer print em dashes; `gsc_inspect.py` flags the deprecated`mobile_usability` field. The README v2.2.1 note now dates the Agenticdiff --git a/README.md b/README.mdindex 9bea74d..c042c2e 100644--- a/README.md+++ b/README.md@@ -319,7 +319,7 @@ Claude SEO runs inside Claude Code, so the pages and data it analyzes are sent t<summary><b>Good to know: requirements, limits and uninstall</b></summary><br />-**Requirements.** Claude Code 1.0.33 or newer and Python 3.10 or newer (3.11 or newer recommended). `/seo setup` installs the headless browser for you.+**Requirements.** Claude Code 1.0.33 or newer and Python 3.11 to 3.14. `/seo setup` installs the headless browser for you.**Cost of a full audit.** Five agents that need more judgment run on Opus and the rest on Sonnet, so a full `/seo audit` uses more of your Claude plan than a single-page check. You can change any agent's model in its file under [`agents/`](agents/).diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.mdindex ed1d920..a482100 100644--- a/docs/ARCHITECTURE.md+++ b/docs/ARCHITECTURE.md@@ -228,8 +228,11 @@ User Request (e.g., /seo page)Bundled tools are dispatched through `scripts/claude-seo` and`scripts/runtime.py`, never through a working-directory-relative Python command.-The launcher resolves Python 3.10 or newer, while the standard-library runtime-provides three operations: `run`, `setup`, and read-only `doctor`.+The launcher resolves a Python in the supported range (3.11 to 3.14, set by+`MIN_PYTHON` and `MAX_PYTHON` in `runtime.py`): `CLAUDE_SEO_PYTHON` if set,+then the default interpreter if it is in range, then the newest versioned one.+The standard-library runtime provides three operations: `run`, `setup`, and+read-only `doctor`.The launcher lives in `scripts/` beside `runtime.py`, which it resolves as asibling. A top-level `bin/` directory is not allowed: the claude.ai-hosteddiff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.mdindex 86b7067..9c0aeb2 100644--- a/docs/INSTALLATION.md+++ b/docs/INSTALLATION.md@@ -2,7 +2,7 @@## Prerequisites-- **Python 3.10+** with pip (3.10 reaches end of life in October 2026; prefer 3.11 or newer)+- **Python 3.11 to 3.14** with pip. Python 3.10 reached end of life in October 2026, and 3.15 waits on the Google Ads client library- **Git** for cloning the repository- **Claude Code CLI** installed and configureddiff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.mdindex 6928e86..02a35af 100644--- a/docs/TROUBLESHOOTING.md+++ b/docs/TROUBLESHOOTING.md@@ -93,8 +93,9 @@ curl -fsSL https://raw.githubusercontent.com/AgriciDaniel/claude-seo/main/requir**Solution (v1.2.0+):** The Windows installer now tries both `python` and `py -3`. If both fail:1. Install Python from [python.org](https://python.org) and check "Add to PATH"-2. Rerun `install.ps1`; it resolves `py -3`, `python3`, then `python`-3. Run `/seo doctor` after installation+2. Rerun `install.ps1`. It uses `CLAUDE_SEO_PYTHON` when set, otherwise the first of `py -3`, `python3` and `python` that is Python 3.11 to 3.14, otherwise the newest of `py -3.14` down to `py -3.11`+3. If `py -3` is a newer Python that Claude SEO does not support yet (such as 3.15), install 3.14 alongside it, or set `CLAUDE_SEO_PYTHON` to a supported `python.exe`+4. Run `/seo doctor` after installation---diff --git a/install.ps1 b/install.ps1index 8432e2a..fb8919a 100644--- a/install.ps1+++ b/install.ps1@@ -9,12 +9,29 @@ Write-Host "| Claude Code SEO Skill |" -ForegroundColor CyanWrite-Host "========================================" -ForegroundColor CyanWrite-Host ""+# Supported range. scripts/runtime.py (MIN_PYTHON, MAX_PYTHON) is the source+# of truth; tests/test_python_range.py keeps this copy in step.+$MinMinor = 11+$MaxMinor = 14+$script:SeenPython = @()+function Resolve-Python {+ # An override must be supported; it is never silently replaced.+ if ($env:CLAUDE_SEO_PYTHON) {+ return Test-PythonCandidate -Exe $env:CLAUDE_SEO_PYTHON -Args @()+ }++ # The default interpreter first, so an existing runtime keeps its Python.+ # 'py -3' means the newest installed, which can be one we do not support yet.$candidates = @(@{ Exe = 'py'; Args = @('-3') },@{ Exe = 'python3'; Args = @() },@{ Exe = 'python'; Args = @() })+ for ($minor = $MaxMinor; $minor -ge $MinMinor; $minor--) {+ $candidates += @{ Exe = 'py'; Args = @("-3.$minor") }+ $candidates += @{ Exe = "python3.$minor"; Args = @() }+ }foreach ($candidate in $candidates) {$resolved = Test-PythonCandidate -Exe $candidate.Exe -Args $candidate.Args@@ -72,15 +89,18 @@ function Test-PythonCandidate {return $null}- $probeCode = 'import sys; print(sys.executable); print(sys.version.split()[0]); raise SystemExit(0 if sys.version_info >= (3, 10) else 1)'+ $probeCode = "import sys; print(sys.executable); print(sys.version.split()[0]); raise SystemExit(0 if (3, $MinMinor) <= sys.version_info[:2] <= (3, $MaxMinor) else 1)"$probe = Invoke-External -Exe $Exe -Args @($Args + @('-c', $probeCode)) -Quiet$probeText = ($probe.Output -join "`n")- if ($probe.ExitCode -ne 0) {+ if ($probeText -match 'Microsoft Store|WindowsApps|App execution alias|was not found') {return $null}- if ($probeText -match 'Microsoft Store|WindowsApps|App execution alias|was not found') {+ if ($probe.ExitCode -ne 0) {+ if ($probe.ExitCode -eq 1 -and $probe.Output.Count -ge 2 -and "$($probe.Output[1])" -match '^\d+\.\d+') {+ $script:SeenPython += "$($probe.Output[1]) ($(@($Exe) + $Args -join ' '))"+ }return $null}@@ -90,7 +110,13 @@ function Test-PythonCandidate {# Check prerequisites$python = Resolve-Pythonif ($null -eq $python) {- Write-Host "[x] Python is required but was not found (tried 'py -3', 'python3', and 'python')." -ForegroundColor Red+ $found = 'no Python'+ if ($script:SeenPython.Count -gt 0) { $found = $script:SeenPython -join ', ' }+ if ($env:CLAUDE_SEO_PYTHON) {+ Write-Host "[x] CLAUDE_SEO_PYTHON must be Python 3.$MinMinor to 3.$MaxMinor. Found: $found." -ForegroundColor Red+ } else {+ Write-Host "[x] Claude SEO needs Python 3.$MinMinor to 3.$MaxMinor. Found: $found. Install Python 3.$MaxMinor from python.org or set CLAUDE_SEO_PYTHON." -ForegroundColor Red+ }exit 1}diff --git a/pyproject.toml b/pyproject.tomlindex c56ff05..5fc3112 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -2,7 +2,7 @@name = "claude-seo"version = "2.4.3"description = "Comprehensive SEO analysis skill for Claude Code"-requires-python = ">=3.10"+requires-python = ">=3.11"license = "MIT"readme = "README.md"authors = [@@ -15,7 +15,7 @@ Homepage = "https://github.com/AgriciDaniel/claude-seo"Repository = "https://github.com/AgriciDaniel/claude-seo"[tool.ruff]-target-version = "py310"+target-version = "py311"line-length = 100[tool.ruff.lint]diff --git a/requirements.txt b/requirements.txtindex d426165..421ebed 100644--- a/requirements.txt+++ b/requirements.txt@@ -1,6 +1,6 @@# Claude SEO - Python Dependencies# Bounded version pinning with security-conscious minimums-# Last updated: September 23, 2026 (v2.4.0 floors)+# Last updated: October 22, 2026 (Python 3.11 floor, Pillow 13)beautifulsoup4>=4.15.0,<5.0.0 # No known CVEsrequests>=2.34.2,<3.0.0 # CVE-2024-47081, CVE-2024-35195 fixes@@ -19,6 +19,7 @@ matplotlib>=3.9.0,<4.0.0 # No known CVEsnumpy>=2.2.6,<3.0.0 # Direct import in google_report.py; matplotlib>=3.9 is the first numpy 2 release lineweasyprint>=70.0,<71.0 # PYSEC-2026-3940 fixed in 70.0openpyxl>=3.1.5,<4.0.0 # No known CVEs (Excel export)+pillow>=13.0.0,<14.0.0 # Transitive via matplotlib and weasyprint; GHSA-22hg-r758-rrw9 and 27 more fixed in 13.0.0# Google API dependencies (for seo-google skill)google-api-python-client>=2.196.0,<3.0.0 # No known CVEsdiff --git a/scripts/claude-seo b/scripts/claude-seoindex 1b7c0d2..a52b7d9 100755--- a/scripts/claude-seo+++ b/scripts/claude-seo@@ -15,25 +15,61 @@ if [[ ! -f "${runtime}" ]]; thenexit 2fi+# Supported range. runtime.py (MIN_PYTHON, MAX_PYTHON) is the source of+# truth; tests/test_python_range.py keeps this copy and install.ps1 in step.+min_minor=11+max_minor=14++# Prints major.minor for the interpreter given as arguments, or nothing.+probe_version() {+ local version+ version="$("$@" -c 'import sys; print("%d.%d" % sys.version_info[:2])' 2>/dev/null)" || return 1+ printf '%s' "${version%$'\r'}"+}++in_range() {+ [[ "$1" =~ ^3\.([0-9]+)$ ]] || return 1+ (( BASH_REMATCH[1] >= min_minor && BASH_REMATCH[1] <= max_minor ))+}++range_text="3.${min_minor} to 3.${max_minor}"+# An override is an executable path, not a shell command. Keeping it as one# array element prevents command injection and supports paths containing spaces.if [[ -n "${CLAUDE_SEO_PYTHON:-}" ]]; then- if "${CLAUDE_SEO_PYTHON}" -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 10) else 1)' >/dev/null 2>&1; then+ found="$(probe_version "${CLAUDE_SEO_PYTHON}" || true)"+ if in_range "${found}"; thenexec "${CLAUDE_SEO_PYTHON}" "${runtime}" "$@"fi- echo "CLAUDE_SEO_PYTHON is not a usable Python 3.10+ executable." >&2+ echo "CLAUDE_SEO_PYTHON must be Python ${range_text}. Found ${found:-no usable Python} at ${CLAUDE_SEO_PYTHON}." >&2exit 2fi-if command -v py >/dev/null 2>&1 && py -3 -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 10) else 1)' >/dev/null 2>&1; then- exec py -3 "${runtime}" "$@"-fi-if command -v python3 >/dev/null 2>&1 && python3 -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 10) else 1)' >/dev/null 2>&1; then- exec python3 "${runtime}" "$@"-fi-if command -v python >/dev/null 2>&1 && python -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 10) else 1)' >/dev/null 2>&1; then- exec python "${runtime}" "$@"-fi+# Prefer the default interpreter when it is supported, so an existing runtime+# keeps the Python it was built with. Otherwise take the newest supported+# versioned one. The choice must be stable: runtime.py rebuilds when it changes.+seen=""+try_python() {+ local found+ command -v "$1" >/dev/null 2>&1 || return 1+ found="$(probe_version "$@")" || return 1+ if in_range "${found}"; then+ exec "$@" "${runtime}" "${script_args[@]+"${script_args[@]}"}"+ fi+ seen="${seen}${seen:+, }${found} ($*)"+ return 1+}++script_args=("$@")+try_python py -3 || true+try_python python3 || true+try_python python || true+minor=${max_minor}+while (( minor >= min_minor )); do+ try_python py "-3.${minor}" || true+ try_python "python3.${minor}" || true+ minor=$(( minor - 1 ))+done-echo "Claude SEO requires Python 3.10 or newer. Tried CLAUDE_SEO_PYTHON, py -3, python3, and python." >&2+echo "Claude SEO needs Python ${range_text}. Found: ${seen:-no Python}. Install Python 3.${max_minor} from python.org or set CLAUDE_SEO_PYTHON to a supported interpreter." >&2exit 2diff --git a/scripts/runtime.py b/scripts/runtime.pyindex 9b3187d..492de95 100755--- a/scripts/runtime.py+++ b/scripts/runtime.py@@ -24,6 +24,11 @@ from pathlib import Pathfrom typing import AnyRUNTIME_SCHEMA = 1+# Supported interpreter range. scripts/claude-seo and install.ps1 repeat these+# bounds, and tests/test_python_range.py keeps every copy in step. 3.15 waits+# on google-ads, whose wheels declare Python < 3.15.+MIN_PYTHON = (3, 11)+MAX_PYTHON = (3, 14)LOCK_STALE_SECONDS = 30 * 60SCRIPT_NAME_RE = re.compile(r"^[A-Za-z0-9][A-Za-z0-9_-]*\.py$")EXTENSION_NAME_RE = re.compile(r"^[a-z0-9][a-z0-9-]*$")@@ -157,6 +162,19 @@ def _expected(root: Path) -> dict[str, Any]:}+def _python_supported() -> bool:+ return MIN_PYTHON <= sys.version_info[:2] <= MAX_PYTHON+++def _python_range_message() -> str:+ found = f"{sys.version_info.major}.{sys.version_info.minor}"+ return (+ f"Claude SEO needs Python {MIN_PYTHON[0]}.{MIN_PYTHON[1]} to "+ f"{MAX_PYTHON[0]}.{MAX_PYTHON[1]}. Found {found} ({sys.executable}). "+ "Install a supported Python or set CLAUDE_SEO_PYTHON."+ )++def _status(root: Path) -> dict[str, Any]:data_dir, mode = _data_dir(root)venv = data_dir / ".venv"@@ -164,6 +182,8 @@ def _status(root: Path) -> dict[str, Any]:state = _load_state(data_dir)expected = _expected(root)reasons: list[str] = []+ if not _python_supported():+ reasons.append(f"python {expected['python']} is outside the supported range")if not python.is_file():reasons.append("managed environment is missing")for key in ("runtime_schema", "requirements_sha256", "python"):@@ -271,6 +291,9 @@ class SetupLock:def command_setup(args: argparse.Namespace) -> int:+ if not _python_supported():+ print(_python_range_message(), file=sys.stderr)+ return 2root = _root()status = _status(root)data_dir: Path = status["data_dir"]diff --git a/tests/test_pyproject_metadata.py b/tests/test_pyproject_metadata.pyindex ef87bdb..f19c55e 100644--- a/tests/test_pyproject_metadata.py+++ b/tests/test_pyproject_metadata.py@@ -20,7 +20,7 @@ def test_pyproject_has_authors_and_keywords() -> None:def test_pyproject_has_minimal_ruff_config_only() -> None:text = (REPO_ROOT / "pyproject.toml").read_text(encoding="utf-8")assert "[tool.ruff]" in text- assert 'target-version = "py310"' in text+ assert 'target-version = "py311"' in textassert "line-length = 100" in textassert "[tool.ruff.lint]" in textassert 'select = ["E", "F", "W", "I"]' in text@@ -41,6 +41,7 @@ def test_requirements_keep_security_and_compatibility_floors() -> None:"lxml_html_clean": (0, 4, 5), # advisories fixed in 0.4.4 and 0.4.5"urllib3": (2, 7, 0),"numpy": (2, 2, 6),+ "pillow": (13, 0, 0), # 28 advisories fixed only in 13.0.0"google-auth-httplib2": (0, 4, 0),"google-ads": (25, 0, 0),}diff --git a/tests/test_python_range.py b/tests/test_python_range.pynew file mode 100644index 0000000..a065a4d--- /dev/null+++ b/tests/test_python_range.py@@ -0,0 +1,143 @@+"""Supported Python range: one policy, enforced by every launcher (CI 2026-10-22).++The Windows runner image gained Python 3.15, and ``py -3`` picked it even+though google-ads does not support it yet. Every copy of the range must agree+with ``runtime.py``, and the launcher must skip an unsupported default.+"""++from __future__ import annotations++import os+import re+import shutil+import subprocess+import sys+from pathlib import Path++import pytest++ROOT = Path(__file__).resolve().parents[1]+sys.path.insert(0, str(ROOT / "scripts"))++import runtime # noqa: E402++LAUNCHER = ROOT / "scripts" / "claude-seo"+MIN_MINOR = runtime.MIN_PYTHON[1]+MAX_MINOR = runtime.MAX_PYTHON[1]+++def _read(relative: str) -> str:+ return (ROOT / relative).read_text(encoding="utf-8")+++def test_runtime_range_is_three_eleven_to_three_fourteen() -> None:+ assert runtime.MIN_PYTHON == (3, 11)+ assert runtime.MAX_PYTHON == (3, 14)+++def test_every_copy_of_the_range_matches_runtime() -> None:+ launcher = _read("scripts/claude-seo")+ assert f"min_minor={MIN_MINOR}" in launcher+ assert f"max_minor={MAX_MINOR}" in launcher+ ps1 = _read("install.ps1")+ assert f"$MinMinor = {MIN_MINOR}" in ps1+ assert f"$MaxMinor = {MAX_MINOR}" in ps1+ assert f'requires-python = ">=3.{MIN_MINOR}"' in _read("pyproject.toml")+ assert f'target-version = "py3{MIN_MINOR}"' in _read("pyproject.toml")+ assert f'requires-python = ">=3.{MIN_MINOR}"' in _read("uv.lock")+ ci = _read(".github/workflows/ci.yml")+ matrix = re.search(r'python-version: \[([^\]]+)\]', ci)+ assert matrix, "ci.yml needs a python-version matrix"+ versions = [v.strip().strip('"') for v in matrix.group(1).split(",")]+ assert versions[0] == f"3.{MIN_MINOR}" and versions[-1] == f"3.{MAX_MINOR}"+ range_text = f"3.{MIN_MINOR} to 3.{MAX_MINOR}"+ for doc in ("README.md", "docs/INSTALLATION.md"):+ assert range_text in _read(doc), f"{doc} must state Python {range_text}"+++def test_no_launcher_or_workflow_still_accepts_three_ten() -> None:+ for relative in ("scripts/claude-seo", "install.ps1", ".github/workflows/ci.yml",+ ".github/workflows/v2.yml", ".github/workflows/windows-smoke.yml"):+ text = _read(relative)+ assert "(3, 10)" not in text, relative+ assert "'3.10'" not in text and '"3.10"' not in text, relative+++def test_powershell_installer_honors_override_and_versioned_fallbacks() -> None:+ ps1 = _read("install.ps1")+ assert "$env:CLAUDE_SEO_PYTHON" in ps1+ assert "\"-3.$minor\"" in ps1+ assert "\"python3.$minor\"" in ps1+++def test_setup_refuses_an_unsupported_interpreter(monkeypatch, capsys) -> None:+ monkeypatch.setattr(runtime, "_python_supported", lambda: False)+ monkeypatch.setattr(runtime, "_root", lambda: pytest.fail("setup must stop first"))+ assert runtime.command_setup(None) == 2+ assert "needs Python 3.11 to 3.14" in capsys.readouterr().err+++posix_only = pytest.mark.skipif(os.name != "posix", reason="stub interpreters are shell scripts")+++def _stub_dir(tmp_path: Path, versions: dict[str, str]) -> Path:+ """Make a PATH holding only fake interpreters plus the tools the launcher needs."""+ bin_dir = tmp_path / "bin"+ bin_dir.mkdir()+ for tool in ("dirname", "basename"):+ real = shutil.which(tool)+ assert real, tool+ (bin_dir / tool).symlink_to(real)+ for name, version in versions.items():+ stub = bin_dir / name+ stub.write_text(+ "#!/bin/sh\n"+ f'if [ "$1" = "-c" ]; then echo {version}; exit 0; fi\n'+ f'echo "picked {name} $(basename "$1")"\n',+ encoding="utf-8",+ )+ stub.chmod(0o755)+ return bin_dir+++def _launch(bin_dir: Path, **env: str) -> subprocess.CompletedProcess:+ bash = shutil.which("bash")+ assert bash+ return subprocess.run(+ [bash, str(LAUNCHER), "doctor"],+ env={"PATH": str(bin_dir), **env},+ capture_output=True,+ text=True,+ timeout=30,+ )+++@posix_only+def test_launcher_skips_unsupported_default_for_newest_supported(tmp_path) -> None:+ bin_dir = _stub_dir(tmp_path, {"python3": "3.15", "python3.14": "3.14", "python3.12": "3.12"})+ result = _launch(bin_dir)+ assert result.returncode == 0, result.stderr+ assert result.stdout.strip() == "picked python3.14 runtime.py"+++@posix_only+def test_launcher_keeps_a_supported_default(tmp_path) -> None:+ bin_dir = _stub_dir(tmp_path, {"python3": "3.12", "python3.14": "3.14"})+ assert _launch(bin_dir).stdout.strip() == "picked python3 runtime.py"+++@posix_only+def test_launcher_names_the_range_when_nothing_fits(tmp_path) -> None:+ bin_dir = _stub_dir(tmp_path, {"python3": "3.15", "python3.10": "3.10"})+ result = _launch(bin_dir)+ assert result.returncode == 2+ assert "needs Python 3.11 to 3.14" in result.stderr+ assert "3.15 (python3)" in result.stderr+++@posix_only+def test_launcher_rejects_an_unsupported_override(tmp_path) -> None:+ bin_dir = _stub_dir(tmp_path, {"python3": "3.12", "py315": "3.15"})+ result = _launch(bin_dir, CLAUDE_SEO_PYTHON=str(bin_dir / "py315"))+ assert result.returncode == 2+ assert "CLAUDE_SEO_PYTHON must be Python 3.11 to 3.14. Found 3.15" in result.stderrdiff --git a/tests/test_runtime_installers.py b/tests/test_runtime_installers.pyindex 6c5e2f3..d666117 100644--- a/tests/test_runtime_installers.py+++ b/tests/test_runtime_installers.py@@ -27,7 +27,7 @@ def test_windows_installer_delegates_to_runtime_without_path_mutation() -> None:assert "SetEnvironmentVariable('PATH'" not in textassert "pip','install" not in textassert "UTF8Encoding($false)" in text- assert "version_info >= (3, 10)" in text+ assert "(3, $MinMinor) <= sys.version_info[:2] <= (3, $MaxMinor)" in textassert "$runtime.ExitCode -ne 0 -and $runtime.ExitCode -ne 10" in textassert "-Directory -Filter 'seo*'" not in text@@ -41,7 +41,6 @@ def test_launcher_is_executable() -> None:def test_launcher_uses_safe_exec() -> None:text = (ROOT / "scripts/claude-seo").read_text(encoding="utf-8")- assert 'exec py -3 "${runtime}" "$@"' in text- assert 'exec python3 "${runtime}" "$@"' in text- assert 'exec python "${runtime}" "$@"' in text+ assert 'exec "${CLAUDE_SEO_PYTHON}" "${runtime}" "$@"' in text+ assert 'exec "$@" "${runtime}" "${script_args[@]+"${script_args[@]}"}"' in textassert "eval " not in textdiff --git a/uv.lock b/uv.lockindex 9720d9b..b791b5b 100644--- a/uv.lock+++ b/uv.lock@@ -1,6 +1,6 @@version = 1revision = 3-requires-python = ">=3.10"+requires-python = ">=3.11"[[package]]name = "claude-seo"