@@ -2,19 +2,26 @@ name: tests
22
33on :
44 push :
5+ branches : [main, v8.3.x]
56 paths-ignore :
67 - " website/**"
78 - " *.md"
89 pull_request :
9- types : [opened, synchronize, reopened, edited ]
10+ branches : ["*" ]
1011 paths-ignore :
1112 - " website/**"
1213 - " *.md"
14+ workflow_dispatch : # allows you to trigger manually
15+
16+ # When this workflow is queued, automatically cancel any previous running
17+ # or pending jobs from the same branch
18+ concurrency :
19+ group : tests-${{ github.ref }}
20+ cancel-in-progress : true
1321
1422jobs :
1523 validate :
1624 name : Validate
17- if : github.repository_owner == 'explosion'
1825 runs-on : ubuntu-latest
1926 steps :
2027 - name : Check out repo
@@ -35,26 +42,31 @@ jobs:
3542 python -m isort thinc --check
3643 - name : flake8
3744 run : |
38- python -m pip install flake8==5.0.4
45+ python -m pip install flake8 -c requirements.txt
3946 python -m flake8 thinc --count --select=E901,E999,F821,F822,F823,W605 --show-source --statistics
47+ - name : mypy
48+ run : |
49+ python -m pip install mypy -c requirements.txt
50+ python -m pip install catalogue confection numpy packaging pydantic
51+ python -m mypy thinc --no-implicit-reexport
52+
4053 tests :
41- name : Test
42- needs : Validate
43- if : github.repository_owner == 'explosion'
54+ name : ${{ matrix.os }} - Python ${{ matrix.python_version }}
4455 strategy :
4556 fail-fast : false
4657 matrix :
47- os : [ubuntu-latest, windows-latest, macos-15-intel]
48- python_version : ["3.12"]
49- include :
50- - os : windows-latest
51- python_version : " 3.10"
52- - os : macos-15-intel
58+ os :
59+ - ubuntu-latest
60+ - ubuntu-24.04-arm
61+ - macos-15-intel
62+ - macos-latest
63+ - windows-latest
64+ - windows-11-arm
65+ python_version : ["3.10", "3.11", "3.12", "3.13"]
66+ exclude :
67+ - os : windows-11-arm
5368 python_version : " 3.10"
54- - os : ubuntu-latest
55- python_version : " 3.11"
56- - os : windows-latest
57- python_version : " 3.11"
69+
5870 runs-on : ${{ matrix.os }}
5971 env :
6072 NOTEBOOK_KERNEL : " thinc-notebook-tests"
@@ -68,26 +80,11 @@ jobs:
6880 with :
6981 python-version : ${{ matrix.python_version }}
7082
71- - name : Install dependencies
72- run : |
73- python -m pip install --upgrade pip setuptools wheel
74- pip install -r requirements.txt
75-
76- - name : Build sdist
77- run : |
78- # Remove the '.eggs' directory in case it's not empty
79- # due to setuptools quirks
80- rm -rf .eggs
81- python setup.py build_ext --inplace
82- rm -rf .eggs
83- python setup.py sdist --formats=gztar
84- shell : bash
83+ - name : Install build dependencies
84+ run : python -m pip install --upgrade build pip wheel
8585
86- - name : Run mypy
87- run : python -m mypy thinc --no-implicit-reexport
88- if : |
89- matrix.python_version != '3.6' &&
90- matrix.python_version != '3.7'
86+ - name : Build sdist and wheel
87+ run : python -m build
9188
9289 - name : Delete source directory
9390 run : rm -rf thinc
@@ -99,28 +96,24 @@ jobs:
9996 pip freeze --exclude pywin32 > installed.txt
10097 pip uninstall -y -r installed.txt
10198
102- - name : Install from sdist
103- run : |
104- SDIST=$(python -c "import os;print(os.listdir('./dist')[-1])" 2>&1)
105- PIP_CONSTRAINT="build-constraints.txt" pip install dist/$SDIST
99+ - name : Install from wheel
100+ run : pip install dist/*.whl
106101 shell : bash
107102
108103 - name : Test import
109104 run : python -c "import thinc"
110105
111106 - name : Install test requirements
112- run : |
113- pip install -r requirements.txt
107+ run : pip install -r requirements.txt
114108
115109 - name : Install notebook test requirements
116- run : |
117- pip install ipykernel pydot graphviz
118- python -m ipykernel install -- name thinc-notebook-tests --user
119- if : matrix.python_version != '3.12'
110+ run : python -m ipykernel install --name thinc-notebook-tests --user
111+
112+ - name : List installed packages
113+ run : python -m pip list
120114
121115 - name : Run tests without extras
122- run : |
123- python -m pytest --pyargs thinc -Werror --cov=thinc --cov-report=term
116+ run : python -m pytest --pyargs thinc --cov=thinc --cov-report=term
124117
125118 # Notes on numpy requirements hacks:
126119 # 1. torch does not have a direct numpy requirement but is compiled
@@ -156,8 +149,8 @@ jobs:
156149 pip uninstall -y tensorflow
157150 pip install "thinc-apple-ops>=1.0.0,<2.0.0"
158151 python -m pytest --pyargs thinc_apple_ops
159- if : matrix .os == 'macos-15-intel ' && matrix.python_version == '3.10'
152+ if : runner .os == 'macOS ' && matrix.python_version == '3.10'
160153
161154 - name : Run tests with thinc-apple-ops
162155 run : python -m pytest --pyargs thinc
163- if : matrix .os == 'macos-15-intel ' && matrix.python_version == '3.10'
156+ if : runner .os == 'macOS ' && matrix.python_version == '3.10'
0 commit comments