@@ -827,35 +827,29 @@ tasks:
827
827
-r "{{.STYLELINTRC_SCHEMA_PATH}}" \
828
828
-d "{{.INSTANCE_PATH}}"
829
829
830
- # Print the version constraint for the project's Poetry tool dependency.
831
830
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml
832
- poetry:get-version :
831
+ poetry:install :
832
+ desc : Install Poetry
833
+ run : once
833
834
cmds :
834
835
- |
835
836
if ! which yq &>/dev/null; then
836
837
echo "yq not found or not in PATH."
837
838
echo "Please install: https://github.com/mikefarah/yq/#install"
838
839
exit 1
839
840
fi
840
- - |
841
- yq \
842
- --input-format toml \
843
- --output-format yaml \
844
- '.tool.poetry.group.pipx.dependencies.poetry' \
845
- < pyproject.toml
846
-
847
- # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml
848
- poetry:install :
849
- desc : Install Poetry
850
- run : once
851
- vars :
852
- POETRY_VERSION :
853
- sh : task poetry:get-version
854
- cmds :
855
841
- |
856
842
if ! which python &>/dev/null; then
843
+ python_constraint="$( \
844
+ yq \
845
+ --input-format toml \
846
+ --output-format yaml \
847
+ '.tool.poetry.dependencies.python' \
848
+ < pyproject.toml
849
+ )"
850
+
857
851
echo "Python not found or not in PATH."
858
- echo "Please install a version of Python meeting the constraint {{.POETRY_VERSION} }:"
852
+ echo "Please install a version of Python satisfying the constraint ${python_constraint }:"
859
853
echo "https://wiki.python.org/moin/BeginnersGuide/Download"
860
854
exit 1
861
855
fi
@@ -870,9 +864,18 @@ tasks:
870
864
task utility:normalize-path \
871
865
RAW_PATH="$(which python)" \
872
866
)"
867
+
868
+ poetry_constraint="$( \
869
+ yq \
870
+ --input-format toml \
871
+ --output-format yaml \
872
+ '.tool.poetry.group.pipx.dependencies.poetry' \
873
+ < pyproject.toml
874
+ )"
875
+
873
876
pipx install \
874
877
--force \
875
- "poetry=={{.POETRY_VERSION}} "
878
+ "poetry==$poetry_constraint "
876
879
877
880
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml
878
881
poetry:install-deps :
0 commit comments