Skip to content

Commit df4d447

Browse files
committed
Add dedicated tasks for installing Poetry-managed dependencies
Poetry is used for managing the project's Python dependencies. This means that several development processes require first running a dependency installation command. Rather than having that command duplicated across the taskfile, it can be put in a dedicated task. This also allows it to be run from the task's `deps` key, which allows it to run in parallel to any other setup processes the task might have.
1 parent 433f90a commit df4d447

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

Taskfile.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,16 +165,32 @@ tasks:
165165
'
166166
fi
167167
168+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml
169+
poetry:install-deps:
170+
desc: Install dependencies managed by Poetry
171+
cmds:
172+
- poetry install --no-root
173+
174+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml
175+
poetry:update-deps:
176+
desc: Update all dependencies managed by Poetry to their newest versions
177+
cmds:
178+
- poetry update
179+
180+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python-task/Taskfile.yml
168181
python:lint:
169182
desc: Lint Python code
183+
deps:
184+
- task: poetry:install-deps
170185
cmds:
171-
- poetry install --no-root
172186
- poetry run flake8 --show-source
173187

188+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python-task/Taskfile.yml
174189
python:format:
175-
desc: Automatically formats Python files
190+
desc: Format Python files
191+
deps:
192+
- task: poetry:install-deps
176193
cmds:
177-
- poetry install --no-root
178194
- poetry run black .
179195

180196
docs:generate:

0 commit comments

Comments
 (0)