Skip to content

Commit

Permalink
Move stubtest CI to GitHub Actions (python#4223)
Browse files Browse the repository at this point in the history
This ensures that the Python version used matches the one used in the
scheduled extraneous stubtest whitelist check.

See also PR python#4206.
  • Loading branch information
srittau authored and Vishal Kuo committed Jun 26, 2020
1 parent 34ea794 commit fe5a10b
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 55 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/stubtest-unused-whitelist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ jobs:
- name: Install dependencies
run: |
python -m pip install -U pip
pip install -U git+git://github.com/python/mypy@b3d43984
pip install -U mypy==0.780
- name: Run stubtest
run: ./tests/stubtest_unused.py
27 changes: 27 additions & 0 deletions .github/workflows/stubtest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Check stubs with stubtest

on:
push:
pull_request:

jobs:
stubtest:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest"]
python-version: [3.5, 3.6, 3.7, 3.8]
fail-fast: false

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -U pip
pip install -U mypy==0.780
- name: Run stubtest
run: ./tests/stubtest_test.py --ignore-unused-whitelist
54 changes: 0 additions & 54 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@ dist: bionic
language: python
python: 3.8

aliases:
test_windows: &test_windows
os: windows
language: shell
env: &env_windows
PATH: /c/Python38:/c/Python38/Scripts:/c/Python37:/c/Python37/Scripts:/c/Python36:/c/Python36/Scripts:/c/Python35:/c/Python35/Scripts:$PATH
before_install:
- choco install python --version $PYTHON_VERSION
- python -m pip install -U pip

jobs:
include:
- name: "pytype"
Expand Down Expand Up @@ -39,47 +29,3 @@ jobs:
- name: "flake8"
install: pip install -r requirements-tests-py3.txt
script: flake8
- name: "stubtest py38"
python: 3.8
install: pip install -U git+git://github.com/python/mypy@b3d43984
script: ./tests/stubtest_test.py --ignore-unused-whitelist
- name: "stubtest py37"
python: 3.7
install: pip install -U git+git://github.com/python/mypy@b3d43984
script: ./tests/stubtest_test.py --ignore-unused-whitelist
- name: "stubtest py36"
python: 3.6
install: pip install -U git+git://github.com/python/mypy@b3d43984
script: ./tests/stubtest_test.py --ignore-unused-whitelist
- name: "stubtest py35"
python: 3.5
install: pip install -U git+git://github.com/python/mypy@b3d43984
script: ./tests/stubtest_test.py --ignore-unused-whitelist
- name: "stubtest py38 (Windows)"
<<: *test_windows
env:
<<: *env_windows
PYTHON_VERSION: 3.8.3
install: pip install -U git+git://github.com/python/mypy@b3d43984
script: python ./tests/stubtest_test.py --ignore-unused-whitelist
- name: "stubtest py37 (Windows)"
<<: *test_windows
env:
<<: *env_windows
PYTHON_VERSION: 3.7.7
install: pip install -U git+git://github.com/python/mypy@b3d43984
script: python ./tests/stubtest_test.py --ignore-unused-whitelist
- name: "stubtest py36 (Windows)"
<<: *test_windows
env:
<<: *env_windows
PYTHON_VERSION: 3.6.8
install: pip install -U git+git://github.com/python/mypy@b3d43984
script: python ./tests/stubtest_test.py --ignore-unused-whitelist
- name: "stubtest py35 (Windows)"
<<: *test_windows
env:
<<: *env_windows
PYTHON_VERSION: 3.5.4
install: pip install -U git+git://github.com/python/mypy@b3d43984
script: python ./tests/stubtest_test.py --ignore-unused-whitelist
4 changes: 4 additions & 0 deletions tests/stubtest_whitelists/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@ posix.[a-z]+_(param|result)._(asdict|make|replace)
# Platform differences that cannot be captured by the type system
fcntl.[A-Z0-9_]+
os.SCHED_[A-Z_]+

# Loadable SQLite extensions are disabled on GitHub runners
sqlite3(.dbapi2)?.Connection.enable_load_extension
sqlite3(.dbapi2)?.Connection.load_extension
1 change: 1 addition & 0 deletions tests/stubtest_whitelists/py38.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ hmac.new # Stub is a white lie; see comments in the stub
http.client.HTTPSConnection.__init__
http.cookiejar.DefaultCookiePolicy.__init__
http.server.SimpleHTTPRequestHandler.__init__
importlib.metadata.DistributionFinder.Context.pattern
importlib.metadata.EntryPointBase
inspect.isasyncgenfunction
inspect.iscoroutinefunction
Expand Down

0 comments on commit fe5a10b

Please sign in to comment.