-
Notifications
You must be signed in to change notification settings - Fork 49
70 lines (56 loc) · 1.86 KB
/
typecheck.yml
File metadata and controls
70 lines (56 loc) · 1.86 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
name: typecheck
on:
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# We stick to Python 3.13 since qiskit-aer is not available yet for Python 3.14.
# See https://github.com/Qiskit/qiskit-aer/issues/2378.
python-version: "3.13"
jobs:
mypy-pyright:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # Fetch all, necessary to find tags and branches
fetch-tags: true
- name: Setup uv
uses: ./.github/actions/setup-uv
with:
enable-cache: true
python-version: ${{ env.python-version }}
- run: uv run --extra dev --extra extra --extra typing mypy
- run: uv run --extra dev --extra extra --extra typing pyright
# Check that `mypy` find installed `graphix` package (#328)
#
# Note that `mypy` does not find editable packages (installed with
# the option `pip install -e`), unless they are installed in
# `compat` or `strict` mode.
#
# pip install -e . --config-settings editable_mode=strict
#
# See https://github.com/pypa/setuptools/issues/3518.
typed-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # Fetch all, necessary to find tags and branches
fetch-tags: true
- name: Setup uv
uses: ./.github/actions/setup-uv
with:
enable-cache: true
python-version: ${{ env.python-version }}
- name: Install graphix and mypy
run: uv sync --extra dev --no-editable
- name: Test type-checking
run: |
cd ${{ runner.temp }}
echo "from graphix import Pattern" > test_graphix_type.py
uv run --project ${{ github.workspace }} --no-sync mypy test_graphix_type.py