diff --git a/.github/workflows/check-versions.yml b/.github/workflows/check-versions.yml index e13e3eb..ae178c7 100644 --- a/.github/workflows/check-versions.yml +++ b/.github/workflows/check-versions.yml @@ -40,17 +40,12 @@ jobs: exit 1 fi - current_dependencies=$(poetry show --only main --format=json | jq -r '.default.dependencies') + current_dependencies=$(poetry show --only main | awk -F' ' '{print $1}') manifest_dependencies=$(jq -r '.requirements[]' custom_components/qss/manifest.json) - for dependency in $manifest_dependencies; do - poetry_version_spec=$(poetry show --only main --format=json "$dependency" | jq -r '.version') - normalized_poetry_version_spec=$(awk '{ sub(/[\^~>=]/, "", $0); print }' <<<"$poetry_version_spec") - normalized_manifest_dependency=$(sed 's/=.*,/>=/' <<<"$dependency") - if ! poetry show --only main --format=json "$normalized_manifest_dependency" &>/dev/null; then - echo "Error: Missing dependency $dependency in pyproject.toml" - exit 1 - elif ! [[ "$normalized_manifest_dependency" =~ $normalized_poetry_version_spec ]]; then - echo "Error: Version mismatch between pyproject.toml ($poetry_version_spec) and manifest.json ($dependency)" + for dependency in $current_dependencies; do + matching_dependency=$(echo "$manifest_dependencies" | grep "$dependency") + if [[ -z "$matching_dependency" ]]; then + echo "Error: Missing dependency $dependency in manifest.json" exit 1 fi done