diff --git a/README.md b/README.md index d7c6b3b..33b5727 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,9 @@ archive workflow. Planning lives in `INTEGRATED_PIPELINE_CONCEPT.md` and ## 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 scripts/work-item next diff --git a/pyproject.toml b/pyproject.toml index 1329dc6..1d6ea4a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "photoanalyzer" version = "0.1.0" -requires-python = ">=3.11" +requires-python = ">=3.12" [tool.ruff] line-length = 100 diff --git a/scripts/python b/scripts/python index d9bca48..6bcbf38 100755 --- a/scripts/python +++ b/scripts/python @@ -1,11 +1,18 @@ #!/bin/sh 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 exec "$python" "$@" fi done -echo "photoanalyzer: Python 3.11 or newer is required" >&2 +echo "photoanalyzer: Python 3.12 or newer is required" >&2 exit 2 diff --git a/tests/test_cli_e2e.py b/tests/test_cli_e2e.py index 7db1478..466e8b1 100644 --- a/tests/test_cli_e2e.py +++ b/tests/test_cli_e2e.py @@ -227,7 +227,7 @@ class InterpreterWrapperTests(unittest.TestCase): ) major, minor = eval(result.stdout.strip(), {"__builtins__": {}}) self.assertEqual(major, 3) - self.assertGreaterEqual(minor, 11) + self.assertGreaterEqual(minor, 12) if __name__ == "__main__": diff --git a/work_item/core.py b/work_item/core.py index 2c7a21b..61d70b1 100644 --- a/work_item/core.py +++ b/work_item/core.py @@ -14,7 +14,7 @@ from typing import Any, Iterable, Sequence try: import tomllib -except ModuleNotFoundError: # pragma: no cover - Python < 3.11 is unsupported +except ModuleNotFoundError: # pragma: no cover - Python < 3.12 is unsupported tomllib = None @@ -77,7 +77,7 @@ class Config: @classmethod def load(cls, path: Path) -> "Config": 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(): raise WorkItemError(f"Missing workflow configuration: {path}") with path.open("rb") as handle: