forked from scikit-image/scikit-image
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (69 loc) · 2.46 KB
/
typing.yml
File metadata and controls
81 lines (69 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Workflow to generate and test type annotations
name: Typing
on: [push, pull_request, merge_group]
concurrency:
# Cancel previously triggered workflows for the same PR
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions:
contents: read
env:
# Many color libraries just need this variable to be set to any value.
# Set it to 3 to support 8-bit color graphics (256 colors per channel)
# for libraries that care about the value set.
FORCE_COLOR: 3
MYPYPATH: ${{ github.workspace }}/stubs
jobs:
docstub:
name: Test docstub
runs-on: ubuntu-latest
steps:
- name: Clone scikit-image
uses: actions/checkout@v5
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.13
cache: "pip"
cache-dependency-path: "requirements/*.txt"
- name: Install docstub
run: |
pip install docstub~=0.6.0
docstub --version
- name: Create skimage-stubs with docstub
shell: bash
run: |
echo -e "## docstub output\n\`\`\`" >> $GITHUB_STEP_SUMMARY
(set -o pipefail && \
docstub run --verbose --group-errors --allow-errors=802 \
--workers -1 --out-dir ${MYPYPATH}/skimage src/skimage/ \
2>&1 | tee -a $GITHUB_STEP_SUMMARY)
echo -e "\`\`\`" >> $GITHUB_STEP_SUMMARY
- name: Create skimage2-stubs with docstub
shell: bash
run: |
echo -e "## docstub output\n\`\`\`" >> $GITHUB_STEP_SUMMARY
(set -o pipefail && \
docstub run --verbose --group-errors \
--out-dir ${MYPYPATH}/skimage2 src/skimage2/ \
2>&1 | tee -a $GITHUB_STEP_SUMMARY)
echo -e "\`\`\`" >> $GITHUB_STEP_SUMMARY
# Not needed yet, since we don't run mypy.stubtest or similar
# which would require importing scikit-image.
#
# - name: Install build dependencies
# env:
# PIP_FLAGS: ${{ matrix.PIP_FLAGS }}
# run: |
# source .github/scripts/setup-build-env.sh
#
# - name: Build and install from source
# run: |
# pip install -v --no-build-isolation .
- uses: actions/upload-artifact@v4
with:
name: skimage-stubs
path: ${MYPYPATH}