Skip to content

Commit a872fdc

Browse files
committed
Prepare for 0.5.3 release.
* Update changelog. * Add 3.14 wheels to build matrix. * Update cibuildwheel version. * Remove special handling of free-threaded builds and use a regular build matrix for them.
1 parent 2c6adf8 commit a872fdc

File tree

6 files changed

+39
-38
lines changed

6 files changed

+39
-38
lines changed

.github/workflows/test.yml

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,32 @@ jobs:
2828
python-version: 3.12
2929
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
3030
build:
31-
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
31+
name: ${{ matrix.os }} Python ${{ matrix.python-version }} freethreaded ${{ matrix.freethreaded }}
3232
runs-on: ${{ matrix.os }}
3333
strategy:
3434
matrix:
3535
os: ["ubuntu-latest"]
36-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
36+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14.0-rc.1"]
37+
freethreaded: [false, true]
38+
exclude:
39+
- python-version: 3.9
40+
freethreaded: true
41+
- python-version: 3.10
42+
freethreaded: true
43+
- python-version: 3.11
44+
freethreaded: true
45+
- python-version: 3.12
46+
freethreaded: true
3747
include:
3848
- os: macos-14
3949
python-version: "3.12"
50+
freethreaded: false
4051
- os: windows-2022
4152
python-version: "3.12"
53+
freethreaded: false
54+
- os: windows-11-arm
55+
python-version: "3.12"
56+
freethreaded: false
4257

4358
steps:
4459
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -49,6 +64,7 @@ jobs:
4964
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
5065
with:
5166
python-version: ${{ matrix.python-version }}
67+
freethreaded: ${{ matrix.freethreaded }}
5268
- name: Install dependencies
5369
run: |
5470
python -m pip install --upgrade pip
@@ -104,32 +120,3 @@ jobs:
104120
- name: Run tests
105121
run: |
106122
pytest -n auto
107-
build-free-threading:
108-
# Later we can merge this job with build similarly to
109-
# https://github.com/python-pillow/Pillow/blob/f0d8fd3059bc1b291563d8a0b1f224b6fd7d0b90/.github/workflows/test.yml#L56-L57
110-
name: Python 3.13 with free-threading
111-
runs-on: ubuntu-latest
112-
steps:
113-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
114-
with:
115-
submodules: true
116-
persist-credentials: false
117-
- name: Set up Python 3.13 with free-threading
118-
# TODO: replace with setup-python when there is support
119-
uses: deadsnakes/action@e640ac8743173a67cca4d7d77cd837e514bf98e8 # v3.2.0
120-
with:
121-
python-version: '3.13-dev'
122-
nogil: true
123-
- name: Install dependencies
124-
run: |
125-
python -m pip install --upgrade pip
126-
python -m pip install setuptools wheel
127-
python -m pip install -U --pre numpy \
128-
-i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
129-
python -c "import numpy; print(f'{numpy.__version__=}')"
130-
- name: Build ml_dtypes
131-
run: |
132-
python -m pip install .[dev] --no-build-isolation
133-
- name: Run tests
134-
run: |
135-
pytest -n auto

.github/workflows/wheels.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ jobs:
2828
strategy:
2929
matrix:
3030
os: [ubuntu-22.04, ubuntu-22.04-arm, macos-14, windows-2022]
31+
cibw_build: "cp39-* cp310-* cp311-* cp312-* cp313-* cp313t-* cp314-* cp314t-*"
32+
include:
33+
- os: windows-11-arm
34+
cibw_build: "cp311-* cp312-* cp313-* cp313t-* cp314-* cp314t-*"
3135

3236
steps:
3337
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -37,18 +41,18 @@ jobs:
3741
# Used to host cibuildwheel
3842
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
3943
with:
40-
python-version: "3.9"
44+
python-version: "3.12"
4145

4246
- name: Install cibuildwheel
43-
run: python -m pip install cibuildwheel==2.20.0
47+
run: python -m pip install cibuildwheel==3.1.2
4448

4549
- name: Build wheels
4650
run: python -m cibuildwheel --output-dir wheelhouse
4751
env:
4852
CIBW_ARCHS_LINUX: auto
4953
CIBW_ARCHS_MACOS: universal2
50-
CIBW_BUILD: cp39-* cp310-* cp311-* cp312-* cp313-* cp313t-*
51-
CIBW_FREE_THREADED_SUPPORT: True
54+
CIBW_BUILD: ${{ matrix.cibw_build }}
55+
CIBW_ENABLE: cpython-freethreading
5256
CIBW_PRERELEASE_PYTHONS: True
5357
CIBW_SKIP: "*musllinux* *i686* *win32* *t-win*"
5458
CIBW_TEST_REQUIRES: absl-py pytest pytest-xdist

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ To release a new version (e.g. from `1.0.0` -> `2.0.0`):
2323

2424
## [Unreleased]
2525

26+
## [0.5.3] - 2025-07-29
27+
28+
* NPY_NEEDS_PYAPI was removed from the dtype flags. This should improve the
29+
speed of array operations, but it does mean that values pickled using
30+
previous versions of ml_dtypes are incompatible with the current release
31+
and should be regenerated with the current release.
32+
* Wheels now support Python 3.14.
33+
* Wheels now support Windows 11 ARM.
34+
2635
## [0.5.2] - 2025-01-31
2736

2837
* Dropped support for Power wheels again. These turned out to cause problems in

ml_dtypes/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = "0.5.1"
15+
__version__ = "0.5.3"
1616
__all__ = [
1717
"__version__",
1818
"bfloat16",

ml_dtypes/tests/intn_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@ def testCastFailure(self, scalar_type):
278278
# But these shouldn't raise exceptions.
279279
np.array(np.nan).astype(scalar_type)
280280
np.array(np.inf).astype(scalar_type)
281-
np.array(1e10).astype(scalar_type)
281+
with np.errstate(invalid="ignore"):
282+
np.array(1e10).astype(scalar_type)
282283

283284

284285
# Tests for the Python scalar type

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "ml_dtypes"
33
dynamic = ["version"] # Load from ml_dtypes.__version__.
4-
description = ""
4+
description = "ml_dtypes is a stand-alone implementation of several NumPy dtype extensions used in machine learning."
55
readme = "README.md"
66
requires-python = ">=3.9"
77
license = "Apache-2.0"

0 commit comments

Comments
 (0)