From 98c342fc79a1ee03cbce9186e5181a80bb315809 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20Mr=C3=A1zek?= Date: Wed, 23 Aug 2023 16:24:20 +0200 Subject: [PATCH] manager/poe: allow python3.7 when executed from manager dir - pyproject.tom: poethepoet for python3.7 --- manager/poe | 10 +++++++--- manager/pyproject.toml | 5 ++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/manager/poe b/manager/poe index 6b75c48f9..abcc2a8d6 100755 --- a/manager/poe +++ b/manager/poe @@ -1,10 +1,14 @@ #!/bin/bash -script_dir="$(dirname "$(realpath "$BASH_SOURCE[0]")")" +script_dir="$(dirname "$(readlink -f "$0")")" -if poetry run python -c 'import sys; sys.exit(0 if sys.version_info >= (3, 8) else 1)'; then +if poetry --directory "$script_dir" run python -c 'import sys; sys.exit(0 if sys.version_info >= (3, 8) else 1)'; then poetry --directory "$script_dir" run poe --root "$script_dir" $@ +elif [ "$PWD" == "$script_dir" ]; then + poetry run poe $@ else - echo "Unsupported Python version - must be >=3.8" >&2 + echo "Running script from non project root is not supported for current 'poethepoet' version." >&2 + echo "poethepoet version - must be >=0.22.0" >&2 + echo "Python version - must be >=3.8" >&2 exit 1 fi diff --git a/manager/pyproject.toml b/manager/pyproject.toml index 3330b8c84..49b34cd54 100644 --- a/manager/pyproject.toml +++ b/manager/pyproject.toml @@ -25,7 +25,10 @@ prometheus-client = "*" [tool.poetry.group.dev.dependencies] poetry = "^1.4.2" pyparsing = "^3.0.9" -poethepoet = { version = "^0.22.0", python = ">=3.8,<4.0" } +poethepoet = [ + { version = "^0.18.1", python = "^3.7" }, + { version = "^0.22.0", python = "^3.8" } +] debugpy = "^1.6.7" [tool.poetry.group.test.dependencies] -- 2.47.2