Skip to content

Commit c706f64

Browse files
authored
Merge pull request #138 from per1234/manage-poetry
Manage versioning of Poetry tool dependency
2 parents e30c6da + 03636cb commit c706f64

File tree

5 files changed

+1535
-15
lines changed

5 files changed

+1535
-15
lines changed

.github/workflows/check-yaml-task.yml

-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-yaml-task.md
22
name: Check YAML
33

4-
env:
5-
# See: https://github.com/actions/setup-python/tree/main#available-versions-of-python
6-
PYTHON_VERSION: "3.9"
7-
84
# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
95
on:
106
create:
@@ -103,9 +99,6 @@ jobs:
10399
with:
104100
python-version-file: pyproject.toml
105101

106-
- name: Install Poetry
107-
run: pip install poetry
108-
109102
- name: Install Task
110103
uses: arduino/setup-task@v2
111104
with:

.github/workflows/spell-check-task.yml

-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/spell-check-task.md
22
name: Spell Check
33

4-
env:
5-
# See: https://github.com/actions/setup-python/tree/main#available-versions-of-python
6-
PYTHON_VERSION: "3.9"
7-
84
# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
95
on:
106
create:
@@ -57,9 +53,6 @@ jobs:
5753
with:
5854
python-version-file: pyproject.toml
5955

60-
- name: Install Poetry
61-
run: pip install poetry
62-
6356
- name: Install Task
6457
uses: arduino/setup-task@v2
6558
with:

Taskfile.yml

+33
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,42 @@ tasks:
347347
-r "{{.STYLELINTRC_SCHEMA_PATH}}" \
348348
-d "{{.INSTANCE_PATH}}"
349349
350+
poetry:install:
351+
desc: Install Poetry
352+
run: once
353+
cmds:
354+
- |
355+
if ! which pipx &>/dev/null; then
356+
echo "pipx not found or not in PATH."
357+
echo "Please install: https://pipx.pypa.io/stable/installation/#installing-pipx"
358+
exit 1
359+
fi
360+
- |
361+
if ! which yq &>/dev/null; then
362+
echo "yq not found or not in PATH."
363+
echo "Please install: https://github.com/mikefarah/yq/#install"
364+
exit 1
365+
fi
366+
- |
367+
export PIPX_DEFAULT_PYTHON="$( \
368+
task utility:normalize-path \
369+
RAW_PATH="$(which python)" \
370+
)"
371+
pipx install \
372+
--force \
373+
"poetry==$( \
374+
yq \
375+
--input-format toml \
376+
--output-format yaml \
377+
'.tool.poetry.group.pipx.dependencies.poetry' \
378+
< pyproject.toml
379+
)"
380+
350381
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml
351382
poetry:install-deps:
352383
desc: Install dependencies managed by Poetry
384+
deps:
385+
- task: poetry:install
353386
cmds:
354387
- poetry install --no-root
355388

0 commit comments

Comments
 (0)