Skip to content

Commit 8abce14

Browse files
committed
Test vs. nightly builds and git tip of key dependencies
1 parent ece0206 commit 8abce14

3 files changed

Lines changed: 66 additions & 2 deletions

File tree

.github/workflows/tests.yml

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
python -m mypy thinc --no-implicit-reexport
5252
5353
tests:
54-
name: ${{ matrix.os }} - Python ${{ matrix.python_version }}
54+
name: ${{ matrix.os }} - Python ${{ matrix.python_version }} ${{ matrix.nightly }}
5555
strategy:
5656
fail-fast: false
5757
matrix:
@@ -63,6 +63,11 @@ jobs:
6363
- windows-latest
6464
- windows-11-arm
6565
python_version: ["3.10", "3.11", "3.12", "3.13"]
66+
nightly: [""] # Use only official releases
67+
include:
68+
- os: ubuntu-latest
69+
python_version: "3.13"
70+
nightly: "nightly" # Use nightly wheels and git tips
6671
exclude:
6772
- os: windows-11-arm
6873
python_version: "3.10"
@@ -83,9 +88,29 @@ jobs:
8388
- name: Install build dependencies
8489
run: python -m pip install --upgrade build pip wheel
8590

91+
- name: Install nightly build dependencies
92+
if: matrix.nightly == 'nightly'
93+
run: |
94+
pip install --upgrade --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple/ numpy blis
95+
96+
# Install dependencies for --no-isolation
97+
pip install setuptools \
98+
"cython>=3.0,<4.0" \
99+
"cymem>=2.0.2,<3" \
100+
"murmurhash>=1.0.2,<2"
101+
102+
# TODO this won't be necessary long term after release 3.0.13
103+
# (replace with "preshed>=3.0.2,<4" above)
104+
pip install git+https://github.com/explosion/preshed.git@v3.0.x
105+
86106
- name: Build sdist and wheel
107+
if: matrix.nightly == ''
87108
run: python -m build
88109

110+
- name: Build sdist and wheel (no build isolation)
111+
if: matrix.nightly == 'nightly'
112+
run: python -m build --no-isolation
113+
89114
- name: Delete source directory
90115
run: rm -rf thinc
91116
shell: bash
@@ -96,10 +121,44 @@ jobs:
96121
pip freeze --exclude pywin32 > installed.txt
97122
pip uninstall -y -r installed.txt
98123
124+
- name: Install nightly runtime dependencies
125+
if: matrix.nightly == 'nightly'
126+
run: |
127+
pip install --upgrade --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple/ numpy blis
128+
129+
# TODO this won't be necessary long term after a free-threading release
130+
# TODO merge https://github.com/ultrajson/ultrajson/pull/689
131+
# pip install git+https://github.com/ultrajson/ultrajson.git
132+
pip install --upgrade git+https://github.com/crusaderky/ultrajson.git@free-threading
133+
134+
# FIXME msgpack-python is not fully compatible with free-threading at the
135+
# moment of writing; naive pip install from git tip fails:
136+
# https://github.com/msgpack/msgpack-python/issues/613
137+
138+
# TODO this won't be necessary long term after release 1.0.0
139+
# FIXME confection git tip is broken
140+
# pip install git+https://github.com/explosion/confection.git@main
141+
142+
# TODO this won't be necessary long term after release 3.0
143+
# TODO merge https://github.com/explosion/srsly/pull/120
144+
# pip install git+https://github.com/explosion/srsly.git
145+
pip install --upgrade git+https://github.com/crusaderky/srsly.git@ft
146+
147+
# TODO this won't be necessary long term after release 3.0.13
148+
pip install --upgrade git+https://github.com/explosion/preshed.git@v3.0.x
149+
99150
- name: Install from wheel
100151
run: pip install dist/*.whl
101152
shell: bash
102153

154+
# FIXME this will go away with srsly 3.0 and confection 1.0 final releases.
155+
- name: Reinstall srsly from git tip
156+
if: matrix.nightly == 'nightly'
157+
run: |
158+
# TODO merge https://github.com/explosion/srsly/pull/120
159+
# pip install git+https://github.com/explosion/srsly.git
160+
pip install --upgrade git+https://github.com/crusaderky/srsly.git@ft
161+
103162
- name: Test import
104163
run: python -c "import thinc"
105164

requirements.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Explosion-provided test dependencies
2-
ml-datasets>=0.2.0,<1
2+
# FIXME do not downgrade srsly on install
3+
# ml-datasets>=0.2.0,<1
4+
ml-datasets @ git+https://github.com/crusaderky/ml-datasets@srsly-v3
5+
36
# Development dependencies
47
hypothesis>=3.27.0,<7
58
pytest>=5.2.0,!=7.1.0

thinc/tests/model/test_model.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,8 @@ def dummy_model(name, layers):
514514
assert a.layers[1].get_ref("y") == y_debug
515515

516516

517+
# NumPy >=2.4 issues a warning when unpacking mnist pickle
518+
@pytest.mark.filterwarnings("ignore::numpy.exceptions.VisibleDeprecationWarning")
517519
@pytest.mark.xfail(
518520
platform.system() == "Darwin",
519521
reason="SSL: CERTIFICATE_VERIFY_FAILED",

0 commit comments

Comments
 (0)