From: Aleš Mrázek Date: Wed, 23 Aug 2023 14:24:20 +0000 (+0200) Subject: manager/poe: allow python3.7 when executed from manager dir X-Git-Tag: v6.0.2~2^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98c342fc79a1ee03cbce9186e5181a80bb315809;p=thirdparty%2Fknot-resolver.git manager/poe: allow python3.7 when executed from manager dir - pyproject.tom: poethepoet for python3.7 --- 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]