File tree Expand file tree Collapse file tree 3 files changed +66
-0
lines changed Expand file tree Collapse file tree 3 files changed +66
-0
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,12 @@ other: &other
119
119
- .github/workflows/*
120
120
- homeassistant/scripts/**
121
121
122
+ requirements :
123
+ - .github/workflows/*
124
+ - homeassistant/package_constraints.txt
125
+ - requirements*.txt
126
+ - setup.py
127
+
122
128
any :
123
129
- *base_platforms
124
130
- *components
Original file line number Diff line number Diff line change 36
36
tests_glob : ${{ steps.info.outputs.tests_glob }}
37
37
test_groups : ${{ steps.info.outputs.test_groups }}
38
38
test_group_count : ${{ steps.info.outputs.test_group_count }}
39
+ requirements : ${{ steps.core.outputs.requirements }}
39
40
runs-on : ubuntu-latest
40
41
steps :
41
42
- name : Check out code from GitHub
@@ -671,6 +672,38 @@ jobs:
671
672
python --version
672
673
mypy homeassistant/components/${{ needs.changes.outputs.integrations_glob }}
673
674
675
+ pip-check :
676
+ runs-on : ubuntu-latest
677
+ if : needs.changes.outputs.requirements == 'true'
678
+ needs :
679
+ - changes
680
+ - prepare-tests
681
+ strategy :
682
+ fail-fast : false
683
+ matrix :
684
+ python-version : [3.9]
685
+ name : Run pip check ${{ matrix.python-version }}
686
+ container : homeassistant/ci-azure:${{ matrix.python-version }}
687
+ steps :
688
+ - name : Check out code from GitHub
689
+
690
+ - name : Restore full Python ${{ matrix.python-version }} virtual environment
691
+ id : cache-venv
692
+
693
+ with :
694
+ path : venv
695
+ key : ${{ runner.os }}-${{ matrix.python-version }}-${{
696
+ needs.prepare-tests.outputs.python-key }}
697
+ - name : Fail job if Python cache restore failed
698
+ if : steps.cache-venv.outputs.cache-hit != 'true'
699
+ run : |
700
+ echo "Failed to restore Python virtual environment from cache"
701
+ exit 1
702
+ - name : Run pip check
703
+ run : |
704
+ . venv/bin/activate
705
+ ./script/pip_check $PIP_CACHE
706
+
674
707
pytest :
675
708
runs-on : ubuntu-latest
676
709
if : needs.changes.outputs.test_full_suite == 'true' || needs.changes.outputs.tests_glob
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ PIP_CACHE=$1
3
+
4
+ # Number of existing dependency conflicts
5
+ # Update if a PR resolve one!
6
+ DEPENDENCY_CONFLICTS=14
7
+
8
+ PIP_CHECK=$( pip check --cache-dir=$PIP_CACHE )
9
+ LINE_COUNT=$( echo " $PIP_CHECK " | wc -l)
10
+ echo " $PIP_CHECK "
11
+
12
+ if [[ $(( LINE_COUNT)) -gt $DEPENDENCY_CONFLICTS ]]
13
+ then
14
+ echo " ------"
15
+ echo " Requirements change added another dependency conflict."
16
+ echo " Make sure to check the 'pip check' output above!"
17
+ exit 1
18
+ elif [[ $(( LINE_COUNT)) -lt $DEPENDENCY_CONFLICTS ]]
19
+ then
20
+ echo " ------"
21
+ echo " It seems like this PR resolves $((
22
+ DEPENDENCY_CONFLICTS - LINE_COUNT)) dependency conflicts."
23
+ echo " Please update the 'DEPENDENCY_CONFLICTS' constant "
24
+ echo " in 'script/pip_check' to help prevent regressions."
25
+ echo " Update it to: $(( LINE_COUNT)) "
26
+ exit 1
27
+ fi
You can’t perform that action at this time.
0 commit comments