-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-91172: Create a workflow for verifying bundled pip and setuptools #31885
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
Changes from 5 commits
e4a8faf
a57cd3a
dcba624
08a1043
6edd10f
6f0d809
809e4db
e46f87d
594644b
a35673b
c82810c
5210374
7d44bbf
633881d
40ff278
685c388
a2e7cd4
d6a355d
a27b7bc
5acf921
7122121
e1b276a
6492602
6625719
0226c29
26cba98
0d3dfaf
fe4c423
6786960
01d3386
7e283c3
a74629c
66a91ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: Verify bundled pip and setuptools | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| paths: | ||
| - 'Lib/ensurepip/_bundled/**' | ||
| pull_request: | ||
| paths: | ||
| - 'Lib/ensurepip/_bundled/**' | ||
|
|
||
| jobs: | ||
| verify: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Compare checksums of bundled pip and setuptools to ones published on PyPI | ||
| run: | | ||
| package_names=("pip" "setuptools") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps this could be moved to a script (say, under
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea, but it looks like all scripts in Do you know how compatible with different platforms scripts located in
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, or perhaps the
I don't know what compatibility is needed, but as this script is primarily intended for Ubuntu on the CI, I'd stick with that.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. This is the latest run after I corrupted the pip wheel temporarily. BTW, I added messages that GitHub has to show as annotations. But I could not see the annotations, maybe it does not show them for binary files…
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| exit_status=0 | ||
|
|
||
| for package_name in "${package_names[@]}"; do | ||
| package_path=$(find Lib/ensurepip/_bundled/ -name "${package_name}*") | ||
| echo $package_path | ||
|
|
||
| package_info=$(curl -fs "https://pypi.org/pypi/${package_name}/json") | ||
| package_file_name=$(basename $package_path) | ||
| package_version=$( | ||
| grep -Pom 1 "_${package_name^^}_VERSION = \"\K[^\"]*" Lib/ensurepip/__init__.py | ||
| ) | ||
| expected_digest=$(echo $package_info | jq --raw-output " | ||
| .releases.\"${package_version}\" | ||
| | .[] | ||
| | select(.filename == \"${package_file_name}\") | ||
| | .digests.sha256 | ||
| ") | ||
| echo "Expected digest: ${expected_digest}" | ||
|
|
||
| actual_digest=$(sha256sum $package_path | awk '{print $1}') | ||
| echo "Actual digest: ${actual_digest}" | ||
|
|
||
| if [ "$actual_digest" = "$expected_digest" ]; then | ||
| echo "Digests are equal." | ||
| else | ||
| echo "Digests are NOT equal." | ||
| exit_status=1 | ||
| fi | ||
| echo | ||
| done | ||
|
|
||
| exit $exit_status | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Create a GitHub Actions workflow for verifying bundled pip and setuptools. | ||
| Patch by Illia Volochii. |

Uh oh!
There was an error while loading. Please reload this page.