fix(web-app-docs): hold the python base inside requires-python

PR 1448 let the image updater move the docs base to python:3.15-slim, where pip refuses infinito-nexus (requires-python >=3.11,<3.15), so every deploy that builds docs failed. docs now pins python:3.14-slim and sets follow: requires-python; followed_tags then proposes only tags whose Python 3 minor requires-python admits.

One reader, utils/requires_python.py, serves the updater filter, the new requires_python lookup (dev-python gets the same string the old regex produced), the ansible cap test and a lint that makes every role image pip-installing core from the repository declare that follow and pin a supported base.

MEDUSA finding MEDUSA-FTSC-SCAN-089 on utils/requires_python.py:25 (ModelAttackScanner, RLHF reward hacking) accepted as a reviewed false positive: the function only parses the repository own requires-python spec.

🎯 Fix: 93 %
💥 Break: 3 %
💸 Cost: –
⏱️ Time: –
🛡️ Security: 100 %
🏆 Score: 90
🚦 Gate: ✅ 90/5, cost and time <= 100, security 100 %

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
kevinveenbirkenbachandClaude Opus 5.5 committed 2026-11-12 00:54:50 +00:00
1 parent a568629421
commit 5322c96891
11 files changed
+280 -26

No files matched your search

@@ -0,0 +1,29 @@
from __future__ import annotations
import tempfile
import unittest
from pathlib import Path
from unittest import mock
from ansible.errors import AnsibleError
from plugins.lookup import requires_python as plugin
class TestRequiresPythonLookup(unittest.TestCase):
def test_the_lookup_returns_the_pyproject_spec(self) -> None:
with tempfile.TemporaryDirectory() as tmp:
Path(tmp, "pyproject.toml").write_text(
'[project]\nname = "demo"\nrequires-python = ">=3.12,<3.14"\n',
encoding="utf-8",
)
with mock.patch.object(plugin, "PROJECT_ROOT", Path(tmp)):
self.assertEqual(plugin.LookupModule().run([]), [">=3.12,<3.14"])
def test_the_lookup_takes_no_terms(self) -> None:
with self.assertRaises(AnsibleError):
plugin.LookupModule().run(["range"])
if __name__ == "__main__":
unittest.main()