-
-
Notifications
You must be signed in to change notification settings - Fork 36.4k
CI: Add job for pip check
#64058
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
CI: Add job for pip check
#64058
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
044f27b
CI: Add job for pip check
cdce8p de42502
Merge remote-tracking branch 'upstream/dev' into ci-pip_check
cdce8p 823a8df
Merge remote-tracking branch 'upstream/dev' into ci-pip_check
cdce8p 649d60f
Merge remote-tracking branch 'upstream/dev' into ci-pip_check
cdce8p dc0db47
Merge remote-tracking branch 'upstream/dev' into ci-pip_check
cdce8p feaa81e
Add pip_check script
cdce8p 2874fc3
Merge remote-tracking branch 'upstream/dev' into ci-pip_check
cdce8p dea4841
Fix pip_check script
cdce8p e852c11
Move DEPENDENCY_CONFLICTS to pip_check script
cdce8p File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,7 @@ env: | |
| PIP_CACHE: /tmp/pip-cache | ||
| SQLALCHEMY_WARN_20: 1 | ||
| PYTHONASYNCIODEBUG: 1 | ||
| DEPENDENCY_CONFLICTS: 14 # Update this one if a PR resolves a dependency conflict | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
|
|
@@ -36,6 +37,7 @@ jobs: | |
| tests_glob: ${{ steps.info.outputs.tests_glob }} | ||
| test_groups: ${{ steps.info.outputs.test_groups }} | ||
| test_group_count: ${{ steps.info.outputs.test_group_count }} | ||
| requirements: ${{ steps.core.outputs.requirements }} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out code from GitHub | ||
|
|
@@ -671,6 +673,38 @@ jobs: | |
| python --version | ||
| mypy homeassistant/components/${{ needs.changes.outputs.integrations_glob }} | ||
|
|
||
| pip-check: | ||
| runs-on: ubuntu-latest | ||
| if: needs.changes.outputs.requirements == 'true' | ||
| needs: | ||
| - changes | ||
| - prepare-tests | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: [3.9] | ||
| name: Run pip check ${{ matrix.python-version }} | ||
| container: homeassistant/ci-azure:${{ matrix.python-version }} | ||
| steps: | ||
| - name: Check out code from GitHub | ||
| uses: actions/[email protected] | ||
| - name: Restore full Python ${{ matrix.python-version }} virtual environment | ||
| id: cache-venv | ||
| uses: actions/[email protected] | ||
| with: | ||
| path: venv | ||
| key: ${{ runner.os }}-${{ matrix.python-version }}-${{ | ||
| needs.prepare-tests.outputs.python-key }} | ||
| - name: Fail job if Python cache restore failed | ||
| if: steps.cache-venv.outputs.cache-hit != 'true' | ||
| run: | | ||
| echo "Failed to restore Python virtual environment from cache" | ||
| exit 1 | ||
| - name: Run pip check | ||
| run: | | ||
| . venv/bin/activate | ||
| ./script/pip_check $PIP_CACHE $DEPENDENCY_CONFLICTS | ||
|
|
||
| pytest: | ||
| runs-on: ubuntu-latest | ||
| if: needs.changes.outputs.test_full_suite == 'true' || needs.changes.outputs.tests_glob | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #!/bin/bash | ||
| PIP_CACHE=$1 | ||
| DEPENDENCY_CONFLICTS=$2 | ||
|
|
||
| PIP_CHECK=$(pip check --cache-dir=$PIP_CACHE) | ||
| LINE_COUNT=$(echo "$PIP_CHECK" | wc -l) | ||
| echo "$PIP_CHECK" | ||
|
|
||
| if [[ $((LINE_COUNT)) -gt 15 ]] | ||
| then | ||
| echo "------" | ||
| echo "Requirements change added another dependency conflict." | ||
| echo "Make sure to check the 'pip check' output above!" | ||
| exit 1 | ||
| elif [[ $((LINE_COUNT)) -lt 15 ]] | ||
| then | ||
| echo "------" | ||
| echo "It seems like this PR resolves $(( | ||
| 15 - LINE_COUNT)) dependency conflicts." | ||
| echo "Please update the 'DEPENDENCY_CONFLICTS' environment variable " | ||
| echo "in '.github/workflows/ci.yaml' to help prevent regressions." | ||
| echo "Update it to: $((LINE_COUNT))" | ||
| exit 1 | ||
| fi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.