-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Run stubtest on stubs on different platforms #8923
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
AlexWaygood
merged 31 commits into
python:main
from
sobolevn:run-stubs-on-different-platforms
Nov 11, 2022
Merged
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
61deba6
Run stubtest on stubs on different platforms
sobolevn 0a96d99
Fix CI
sobolevn 8149e3c
Fix CI
sobolevn 7d364f7
Fix CI
sobolevn 1a9af3a
Address review
sobolevn f00714a
Run daily on differeny platforms
sobolevn 3f31bed
Fix daily run
sobolevn 8eb0c83
Merge branch 'master' into run-stubs-on-different-platforms
AlexWaygood c8650b3
Rename `stubtest` files
sobolevn 770c5aa
Merge branch 'run-stubs-on-different-platforms' of https://github.com…
sobolevn fdf13bb
Add platform-specific allowlists for stubs
sobolevn c84fe27
Fix CI
sobolevn 40a4c50
Fix CI
sobolevn 025568b
Try `Pillow~=7.1.2`
sobolevn c8b6472
Skip `D3DShot`
sobolevn 21eb994
Revert `win32` change
sobolevn ac06a7c
Fix CI
sobolevn 081ebba
Merge branch 'master' into run-stubs-on-different-platforms
sobolevn 0be8c9b
Address review
sobolevn ec000eb
Merge branch 'run-stubs-on-different-platforms' of https://github.com…
sobolevn 3bb8296
Update CONTRIBUTING.md
sobolevn 870daa6
Merge main
sobolevn c4f86da
Fix allowlist of win32
sobolevn 183ea56
Merge branch 'main' into run-stubs-on-different-platforms
AlexWaygood a6b1cab
Update stubtest_allowlist_win32.txt
sobolevn bf2f10e
Update tests/get_packages.py
sobolevn 578f619
Merge remote-tracking branch 'origin/main' into run-stubs-on-differen…
AlexWaygood 7df5a1f
Delete unused allowlist entries
AlexWaygood 949bf46
Update CONTRIBUTING.md
sobolevn faac1be
Apply suggestions from code review
sobolevn 9464335
Add TODO comment back
AlexWaygood 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Run stubtest | ||
name: Stdlib stubtest | ||
|
||
on: | ||
workflow_dispatch: | ||
|
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,70 @@ | ||
name: Third-party stubtest | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- '**/*.md' | ||
- 'scripts/**' | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
PIP_DISABLE_PIP_VERSION_CHECK: 1 | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
stubtest-third-party: | ||
name: Check third party stubs with stubtest | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: ["ubuntu-latest", "windows-latest", "macos-latest"] | ||
fail-fast: false | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
- name: Install dependencies | ||
run: pip install -r requirements-tests.txt | ||
- name: Run stubtest | ||
shell: bash | ||
run: | | ||
STUBS=$( | ||
git diff --name-only origin/${{ github.base_ref }} HEAD | | ||
# Use the daily.yml workflow to run stubtest on all third party stubs | ||
egrep ^stubs/ | cut -d "/" -f 2 | sort -u | (while read stub; do [ -d stubs/$stub ] && echo $stub || true; done) | ||
) | ||
|
||
if [ -n "$STUBS" ]; then | ||
echo "Testing $STUBS..." | ||
PACKAGES=$(python tests/get_packages.py $STUBS) | ||
|
||
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then | ||
if [ -n "$PACKAGES" ]; then | ||
echo "Installing apt packages: $PACKAGES" | ||
sudo apt update && sudo apt install -y $PACKAGES | ||
fi | ||
xvfb-run python tests/stubtest_third_party.py $STUBS | ||
fi | ||
|
||
if [ "${{ matrix.os }}" = "macos-latest" ]; then | ||
# Could install brew packages here if we run into stubs that need it | ||
python tests/stubtest_third_party.py $STUBS | ||
fi | ||
|
||
if [ "${{ matrix.os }}" = "windows-latest" ]; then | ||
# Could install choco packages here if we run into stubs that need it | ||
python tests/stubtest_third_party.py $STUBS | ||
fi | ||
else | ||
echo "Nothing to test" | ||
fi |
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
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
version = "0.5.*" | ||
|
||
[tool.stubtest] | ||
platforms = ["linux"] | ||
apt_dependencies = ["libjack-dev"] |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
version = "0.2.*" | ||
|
||
[tool.stubtest] | ||
platforms = ["linux"] | ||
apt_dependencies = ["portaudio19-dev"] |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
version = "7.45.*" | ||
|
||
[tool.stubtest] | ||
platforms = ["linux"] | ||
apt_dependencies = ["libcurl4-openssl-dev"] |
File renamed without changes.
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
version = "305.*" | ||
|
||
[tool.stubtest] | ||
platforms = ["win32"] | ||
ignore_missing_stub = false | ||
# The library only works on Windows; we currently only run stubtest on Ubuntu for third-party stubs in CI. | ||
# See #8660 | ||
skip = true |
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 was deleted.
Oops, something went wrong.
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,23 @@ | ||
#!/usr/bin/env python3 | ||
import os | ||
import sys | ||
|
||
import tomli | ||
|
||
platform = sys.platform | ||
distributions = sys.argv[1:] | ||
if not distributions: | ||
distributions = os.listdir("stubs") | ||
|
||
metadata_mapping = { | ||
"linux": "apt_dependencies", | ||
# We could add others here if we run into stubs that need it: | ||
# "darwin": "brew_dependencies", | ||
# "win32": "choco_dependencies", | ||
} | ||
|
||
if platform in metadata_mapping: | ||
for distribution in distributions: | ||
with open(f"stubs/{distribution}/METADATA.toml", "rb") as file: | ||
for package in tomli.load(file).get("tool", {}).get("stubtest", {}).get(metadata_mapping[platform], []): | ||
print(package) |
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
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.