Skip to content

Commit df1e1f7

Browse files
committed
[stubgenc] Move stubgenc CI test in separate workflow
1 parent 7d4f8a2 commit df1e1f7

File tree

4 files changed

+46
-34
lines changed

4 files changed

+46
-34
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -47,33 +47,3 @@ jobs:
4747
run: tox -e ${{ matrix.toxenv }} --notest
4848
- name: test
4949
run: tox -e ${{ matrix.toxenv }} --skip-pkg-install
50-
51-
stubgenc:
52-
# Check stub file generation for a small pybind11 project
53-
# (full text match is required to pass)
54-
runs-on: ubuntu-latest
55-
steps:
56-
57-
- uses: actions/checkout@v2
58-
59-
- name: initialize submodules
60-
run: git submodule update --init
61-
62-
- name: Setup 🐍 3.8
63-
uses: actions/setup-python@v2
64-
with:
65-
python-version: 3.8
66-
67-
- name: Prepare env
68-
run: |
69-
python -m pip install -r test-requirements.txt
70-
python -m pip install .
71-
72-
- name: Run stubgen
73-
run: |
74-
rm -rf test-data/stubgen/python_example
75-
stubgen -p python_example -o test-data/stubgen/
76-
77-
- name: Check output
78-
run: |
79-
git diff --exit-code test-data/stubgen/

.github/workflows/test_stubgenc.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Test stubgenc on pybind11-mypy-demo
2+
3+
on:
4+
push:
5+
branches: [master]
6+
tags: ['*']
7+
pull_request:
8+
paths:
9+
- 'mypy/stubgenc.py'
10+
- 'mypy/stubdoc.py'
11+
- 'test-data/stubgen/**'
12+
13+
jobs:
14+
stubgenc:
15+
# Check stub file generation for a small pybind11 project
16+
# (full text match is required to pass)
17+
runs-on: ubuntu-latest
18+
steps:
19+
20+
- uses: actions/checkout@v2
21+
22+
- name: initialize submodules
23+
run: git submodule update --init
24+
25+
- name: Setup 🐍 3.8
26+
uses: actions/setup-python@v2
27+
with:
28+
python-version: 3.8
29+
30+
- name: Test stubgenc
31+
run: misc/test-stubgenc.sh

misc/test-stubgenc.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
# This script is expected to be run from root of the mypy repo
3+
4+
# Install dependencies, demo project and mypy
5+
python -m pip install -r test-requirements.txt
6+
python -m pip install pybind11 numpy
7+
python -m pip install git+https://github.com/sizmailov/python_example.git@pybind11-mypy-demo
8+
python -m pip install .
9+
10+
# Remove expected stubs and generate new inplace
11+
rm -rf test-data/stubgen/python_example
12+
stubgen -p python_example -o test-data/stubgen/
13+
14+
# Compare generated stubs to expected ones
15+
git diff --exit-code test-data/stubgen/python_example

test-requirements.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,3 @@ py>=1.5.2
1515
virtualenv<20
1616
setuptools!=50
1717
importlib-metadata==0.20
18-
# stubgen compatibility with pybind
19-
pybind11
20-
numpy
21-
git+https://github.com/sizmailov/python_example.git@mypy-stubgen-test

0 commit comments

Comments
 (0)