Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
61deba60a96d998149e3c7d364f71a9af3af00714a3f31bed8eb0c83c8650b3770c5aafdf13bbc84fe2740a4c50025568bc8b647221eb994ac06a7c081ebba0be8c9bec000eb3bb8296870daa6c4f86da183ea56a6b1cabbf2f10e578f6197df5a1f949bf46faac1be9464335File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| name: Run stubtest | ||
| name: Stdlib stubtest | ||
| on: | ||
| workflow_dispatch: | ||
| 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 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2,6 +2,7 @@ version = "0.1.*" | ||
| requires = ["types-Pillow"] | ||
| [tool.stubtest] | ||
| # The library only works on Windows; we currently only run stubtest on Ubuntu for third-party stubs in CI. | ||
| # See #8660 | ||
| # TODO: figure out how to run stubtest for this package | ||
| # (the package pins Pillow in a problematic way) | ||
| skip = true | ||
AlexWaygood marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| platforms = ["win32"] | ||
| 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"] |
| 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"] |
| 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"] |
| 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 was deleted.
Uh oh!
There was an error while loading. Please reload this page.
| 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) |
Uh oh!
There was an error while loading. Please reload this page.