Skip to content

Only install Python package dependencies from relevant group #606

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,8 @@ tasks:
desc: Check for commonly misspelled words
deps:
- task: poetry:install-deps
vars:
POETRY_GROUPS: dev
cmds:
- poetry run codespell

Expand Down Expand Up @@ -555,6 +557,8 @@ tasks:
desc: Correct commonly misspelled words where possible
deps:
- task: poetry:install-deps
vars:
POETRY_GROUPS: dev
cmds:
- poetry run codespell --write-changes

Expand Down Expand Up @@ -898,6 +902,8 @@ tasks:
desc: Format Python files
deps:
- task: poetry:install-deps
vars:
POETRY_GROUPS: dev
cmds:
- poetry run black .

Expand All @@ -906,6 +912,8 @@ tasks:
desc: Lint Python code
deps:
- task: poetry:install-deps
vars:
POETRY_GROUPS: dev
cmds:
- poetry run flake8 --show-source

Expand Down Expand Up @@ -1012,5 +1020,7 @@ tasks:
desc: Check for problems with YAML files
deps:
- task: poetry:install-deps
vars:
POETRY_GROUPS: dev
cmds:
- poetry run yamllint --format {{default "colored" .YAMLLINT_FORMAT}} .
4 changes: 4 additions & 0 deletions workflow-templates/assets/check-mkdocs-task/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ tasks:
deps:
- task: docs:generate
- task: poetry:install-deps
vars:
POETRY_GROUPS: dev
cmds:
- poetry run mkdocs build --strict

Expand All @@ -22,5 +24,7 @@ tasks:
deps:
- task: docs:generate
- task: poetry:install-deps
vars:
POETRY_GROUPS: dev
cmds:
- poetry run mkdocs serve
4 changes: 4 additions & 0 deletions workflow-templates/assets/check-python-task/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ tasks:
desc: Format Python files
deps:
- task: poetry:install-deps
vars:
POETRY_GROUPS: dev
cmds:
- poetry run black .

Expand All @@ -15,5 +17,7 @@ tasks:
desc: Lint Python code
deps:
- task: poetry:install-deps
vars:
POETRY_GROUPS: dev
cmds:
- poetry run flake8 --show-source
2 changes: 2 additions & 0 deletions workflow-templates/assets/check-yaml-task/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ tasks:
desc: Check for problems with YAML files
deps:
- task: poetry:install-deps
vars:
POETRY_GROUPS: dev
cmds:
- poetry run yamllint --format {{default "colored" .YAMLLINT_FORMAT}} .
10 changes: 8 additions & 2 deletions workflow-templates/assets/poetry-task/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,17 @@ tasks:

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml
poetry:install-deps:
desc: Install dependencies managed by Poetry
desc: |
Install dependencies managed by Poetry.
Environment variable parameters:
- POETRY_GROUPS: Poetry dependency groups to install (default: install all dependencies).
run: when_changed
deps:
- task: poetry:install
cmds:
- poetry install --no-root
- |
poetry install \
{{if .POETRY_GROUPS}} --only {{.POETRY_GROUPS}} {{end}}

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml
poetry:update-deps:
Expand Down
4 changes: 4 additions & 0 deletions workflow-templates/assets/spell-check-task/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ tasks:
desc: Check for commonly misspelled words
deps:
- task: poetry:install-deps
vars:
POETRY_GROUPS: dev
cmds:
- poetry run codespell

Expand All @@ -15,5 +17,7 @@ tasks:
desc: Correct commonly misspelled words where possible
deps:
- task: poetry:install-deps
vars:
POETRY_GROUPS: dev
cmds:
- poetry run codespell --write-changes
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ tasks:
deps:
- task: go:build
- task: poetry:install-deps
vars:
POETRY_GROUPS: dev
cmds:
- poetry run pytest tests
Loading