Skip to content

Manage versioning of Poetry tool dependency #138

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
Mar 16, 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
7 changes: 0 additions & 7 deletions .github/workflows/check-yaml-task.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-yaml-task.md
name: Check YAML

env:
# See: https://github.com/actions/setup-python/tree/main#available-versions-of-python
PYTHON_VERSION: "3.9"

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
create:
Expand Down Expand Up @@ -103,9 +99,6 @@ jobs:
with:
python-version-file: pyproject.toml

- name: Install Poetry
run: pip install poetry

- name: Install Task
uses: arduino/setup-task@v2
with:
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/spell-check-task.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/spell-check-task.md
name: Spell Check

env:
# See: https://github.com/actions/setup-python/tree/main#available-versions-of-python
PYTHON_VERSION: "3.9"

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
create:
Expand Down Expand Up @@ -57,9 +53,6 @@ jobs:
with:
python-version-file: pyproject.toml

- name: Install Poetry
run: pip install poetry

- name: Install Task
uses: arduino/setup-task@v2
with:
Expand Down
33 changes: 33 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
vars:
# Path of the primary npm-managed project:
DEFAULT_NPM_PROJECT_PATH: ./
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/release-go-task/Taskfile.yml

Check warning on line 10 in Taskfile.yml

View workflow job for this annotation

GitHub Actions / Generate problem matcher output

10:121 [line-length] line too long (126 > 120 characters)
PROJECT_NAME: "arduinoOTA"
DIST_DIR: "dist"
# build vars
Expand All @@ -19,7 +19,7 @@
sh: echo "{{now | date "20060102"}}"
TAG:
sh: echo "$(git tag --points-at=HEAD 2> /dev/null | head -n1)"
VERSION: "{{if .NIGHTLY}}nightly-{{.TIMESTAMP_SHORT}}{{else if .TAG}}{{.TAG}}{{else}}{{.PACKAGE_NAME_PREFIX}}git-snapshot{{end}}"

Check warning on line 22 in Taskfile.yml

View workflow job for this annotation

GitHub Actions / Generate problem matcher output

22:121 [line-length] line too long (131 > 120 characters)
CONFIGURATION_PACKAGE: "github.com/arduino/arduinoOTA/version"
LDFLAGS: >-
-ldflags
Expand All @@ -32,10 +32,10 @@
DEFAULT_GO_MODULE_PATH: ./
DEFAULT_GO_PACKAGES:
sh: |
echo $(cd {{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}} && go list ./... | tr '\n' ' ' || echo '"ERROR: Unable to discover Go packages"')

Check warning on line 35 in Taskfile.yml

View workflow job for this annotation

GitHub Actions / Generate problem matcher output

35:121 [line-length] line too long (149 > 120 characters)

tasks:
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-workflows-task/Taskfile.yml

Check warning on line 38 in Taskfile.yml

View workflow job for this annotation

GitHub Actions / Generate problem matcher output

38:121 [line-length] line too long (131 > 120 characters)
ci:validate:
desc: Validate GitHub Actions workflows against their JSON schema
vars:
Expand Down Expand Up @@ -68,7 +68,7 @@
# This is an "umbrella" task used to call any documentation generation processes the project has.
# It can be left empty if there are none.

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-general-formatting-task/Taskfile.yml

Check warning on line 71 in Taskfile.yml

View workflow job for this annotation

GitHub Actions / Generate problem matcher output

71:121 [line-length] line too long (140 > 120 characters)
general:check-formatting:
desc: Check basic formatting style of all files
cmds:
Expand All @@ -80,7 +80,7 @@
fi
- ec

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-prettier-formatting-task/Taskfile.yml

Check warning on line 83 in Taskfile.yml

View workflow job for this annotation

GitHub Actions / Generate problem matcher output

83:121 [line-length] line too long (141 > 120 characters)
general:format-prettier:
desc: Format all supported files with Prettier
deps:
Expand All @@ -92,7 +92,7 @@
--write \
.

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-dependencies-task/Taskfile.yml

Check warning on line 95 in Taskfile.yml

View workflow job for this annotation

GitHub Actions / Generate problem matcher output

95:121 [line-length] line too long (134 > 120 characters)
general:cache-dep-licenses:
desc: Cache dependency license metadata
cmds:
Expand Down Expand Up @@ -347,9 +347,42 @@
-r "{{.STYLELINTRC_SCHEMA_PATH}}" \
-d "{{.INSTANCE_PATH}}"

poetry:install:
desc: Install Poetry
run: once
cmds:
- |
if ! which pipx &>/dev/null; then
echo "pipx not found or not in PATH."
echo "Please install: https://pipx.pypa.io/stable/installation/#installing-pipx"
exit 1
fi
- |
if ! which yq &>/dev/null; then
echo "yq not found or not in PATH."
echo "Please install: https://github.com/mikefarah/yq/#install"
exit 1
fi
- |
export PIPX_DEFAULT_PYTHON="$( \
task utility:normalize-path \
RAW_PATH="$(which python)" \
)"
pipx install \
--force \
"poetry==$( \
yq \
--input-format toml \
--output-format yaml \
'.tool.poetry.group.pipx.dependencies.poetry' \
< pyproject.toml
)"

# 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
deps:
- task: poetry:install
cmds:
- poetry install --no-root

Expand Down
Loading
Loading