Require Python 3.12 for workflow automation
This commit is contained in:
@@ -6,7 +6,9 @@ archive workflow. Planning lives in `INTEGRATED_PIPELINE_CONCEPT.md` and
|
|||||||
|
|
||||||
## Agent workflow helper
|
## Agent workflow helper
|
||||||
|
|
||||||
Requirements: Python 3.11+, Git, and an authenticated `tea` login named `domverse`.
|
Requirements: Python 3.12+, Git, and an authenticated `tea` login named `domverse`.
|
||||||
|
`scripts/python` prefers Conda base when it satisfies this version, otherwise it uses
|
||||||
|
an installed Python 3.12+ interpreter.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
scripts/work-item next
|
scripts/work-item next
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "photoanalyzer"
|
name = "photoanalyzer"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
requires-python = ">=3.11"
|
requires-python = ">=3.12"
|
||||||
|
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
line-length = 100
|
line-length = 100
|
||||||
|
|||||||
@@ -1,11 +1,18 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
for python in python3.13 python3.12 python3.11; do
|
if command -v conda >/dev/null 2>&1; then
|
||||||
|
conda_version=$(conda run -n base python -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2>/dev/null || true)
|
||||||
|
case "$conda_version" in
|
||||||
|
3.1[2-9]|3.[2-9][0-9]) exec conda run --no-capture-output -n base python "$@" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
for python in python3.13 python3.12; do
|
||||||
if command -v "$python" >/dev/null 2>&1; then
|
if command -v "$python" >/dev/null 2>&1; then
|
||||||
exec "$python" "$@"
|
exec "$python" "$@"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "photoanalyzer: Python 3.11 or newer is required" >&2
|
echo "photoanalyzer: Python 3.12 or newer is required" >&2
|
||||||
exit 2
|
exit 2
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ class InterpreterWrapperTests(unittest.TestCase):
|
|||||||
)
|
)
|
||||||
major, minor = eval(result.stdout.strip(), {"__builtins__": {}})
|
major, minor = eval(result.stdout.strip(), {"__builtins__": {}})
|
||||||
self.assertEqual(major, 3)
|
self.assertEqual(major, 3)
|
||||||
self.assertGreaterEqual(minor, 11)
|
self.assertGreaterEqual(minor, 12)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ from typing import Any, Iterable, Sequence
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
import tomllib
|
import tomllib
|
||||||
except ModuleNotFoundError: # pragma: no cover - Python < 3.11 is unsupported
|
except ModuleNotFoundError: # pragma: no cover - Python < 3.12 is unsupported
|
||||||
tomllib = None
|
tomllib = None
|
||||||
|
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ class Config:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def load(cls, path: Path) -> "Config":
|
def load(cls, path: Path) -> "Config":
|
||||||
if tomllib is None:
|
if tomllib is None:
|
||||||
raise WorkItemError("Python 3.11 or newer is required")
|
raise WorkItemError("Python 3.12 or newer is required")
|
||||||
if not path.is_file():
|
if not path.is_file():
|
||||||
raise WorkItemError(f"Missing workflow configuration: {path}")
|
raise WorkItemError(f"Missing workflow configuration: {path}")
|
||||||
with path.open("rb") as handle:
|
with path.open("rb") as handle:
|
||||||
|
|||||||
Reference in New Issue
Block a user