-
-
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
Changes from 29 commits
61deba6
0a96d99
8149e3c
7d364f7
1a9af3a
f00714a
3f31bed
8eb0c83
c8650b3
770c5aa
fdf13bb
c84fe27
40a4c50
025568b
c8b6472
21eb994
ac06a7c
081ebba
0be8c9b
ec000eb
3bb8296
870daa6
c4f86da
183ea56
a6b1cab
bf2f10e
578f619
7df5a1f
949bf46
faac1be
9464335
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 |
---|---|---|
@@ -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 | | ||
# Uncomment the following to (very slowly) run on all third party stubs: | ||
# git ls-files | | ||
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 | ||
# TODO: install brew packages | ||
sobolevn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
python tests/stubtest_third_party.py $STUBS | ||
fi | ||
|
||
if [ "${{ matrix.os }}" = "windows-latest" ]; then | ||
python tests/stubtest_third_party.py $STUBS | ||
sobolevn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
fi | ||
else | ||
echo "Nothing to test" | ||
fi |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -2,6 +2,6 @@ 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: re-enable | ||||
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.
Suggested change
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. Wait, this TODO comment I did like -- it would be good if we could figure out how to enable stubtest for this package! |
||||
skip = true | ||||
AlexWaygood marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
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.
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.