forked from home-assistant/core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpip_check
executable file
·28 lines (25 loc) · 875 Bytes
/
pip_check
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
PIP_CACHE=$1
# Number of existing dependency conflicts
# Update if a PR resolve one!
DEPENDENCY_CONFLICTS=3
PIP_CHECK=$(pip check --cache-dir=$PIP_CACHE)
LINE_COUNT=$(echo "$PIP_CHECK" | wc -l)
echo "$PIP_CHECK"
if [[ $((LINE_COUNT)) -gt $DEPENDENCY_CONFLICTS ]]
then
echo "------"
echo "Requirements change added another dependency conflict."
echo "Make sure to check the 'pip check' output above!"
echo "Expected $DEPENDENCY_CONFLICTS conflicts, got $LINE_COUNT."
exit 1
elif [[ $((LINE_COUNT)) -lt $DEPENDENCY_CONFLICTS ]]
then
echo "------"
echo "It seems like this PR resolves $((
DEPENDENCY_CONFLICTS - LINE_COUNT)) dependency conflicts."
echo "Please update the 'DEPENDENCY_CONFLICTS' constant "
echo "in 'script/pip_check' to help prevent regressions."
echo "Update it to: $((LINE_COUNT))"
exit 1
fi