Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
CM000n committed Dec 14, 2023
1 parent 1b21ecf commit 3f1c568
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/check-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3f1c568

Please sign in to comment.