Skip to content

Commit 3a310fa

Browse files
committed
Only install Python package dependencies from relevant group
The "Poetry" tool is used to manage the project's Python package dependencies. Dependencies might be classified into distinct categories. The most basic classification would be: - Application dependencies: used by the project's applications - Development dependencies: tools used in the development and maintenance of the project, but not by the application By default, Poetry installs all non-optional dependencies. This can be inefficient in a case where a specific operation is being performed, since a given operation might only require the dependencies from one category and so the installation of dependencies from the other is pointless for that operation. For this reason, Poetry allows the user to organize dependencies into arbitrary "groups", and to specify which groups should be installed. The Python package installation task is hereby updated to allow dependency groups to be specified, and the calls to that task updated to specify the groups they require.
1 parent d4e6240 commit 3a310fa

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Taskfile.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -883,11 +883,16 @@ tasks:
883883
884884
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml
885885
poetry:install-deps:
886-
desc: Install dependencies managed by Poetry
886+
desc: |
887+
Install dependencies managed by Poetry.
888+
Environment variable parameters:
889+
- POETRY_GROUPS: Poetry dependency groups to install (default: install all dependencies).
887890
deps:
888891
- task: poetry:install
889892
cmds:
890-
- poetry install --no-root
893+
- |
894+
poetry install \
895+
{{if .POETRY_GROUPS}} --only {{.POETRY_GROUPS}} {{end}}
891896
892897
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml
893898
poetry:update-deps:

0 commit comments

Comments
 (0)