Skip to content

Commit 3a91802

Browse files
authored
Use python 3.14 environment in GitHub workflows (#2922)
This PR updates the remaining GitHub workflows and conda environments to run under python 3.14, and bumps coveralls to 4.1.0 (which supports 3.14). ### Version bumps (3.13/3.12 → 3.14) - `check-onemath.yaml` — oneMath interface tests - `conda-package.yml` — array API conformance tests (`python-ver`) - `environments/building_docs.yml` — docs build - `environments/upload_cleanup_conda_pkg.yml` — conda package upload/cleanup - `environments/coverage.yml` — coverage job (was pinned to `3.12`) ### Coverage job fixes for python 3.14 Bumping the coverage environment from 3.12 to 3.14 surfaced two failures unrelated to dpnp's runtime code — both stem from how coverage instrumentation interacts with 3.14's `sys.monitoring`: **1. Build failure — `undeclared identifier '__Pyx_MonitoringEventTypes_CyGen_count'`** Coverage builds compile every extension with `CYTHON_TRACE=1` (`DPNP_GENERATE_COVERAGE=ON`), but Cython line tracing also needs the matching `# cython: linetrace=True` directive at cythonize time. Three `.pyx` files were missing it (`_slicing.pyx`, `_stride_utils.pyx`, `_types.pyx`): without the directive, Cython references `__Pyx_MonitoringEventTypes_CyGen_count` (from the shared generator/coroutine struct) but never defines it. On python ≤3.12 the guarding `CYTHON_USE_SYS_MONITORING` macro is `0`, so the code was unreachable — which is why the previous `3.12` pin hid this; on 3.13+ it becomes reachable and fails to compile. Added the directive to the three files. As a side effect, these files were previously producing no line-coverage data and are now measured. **2. Test failures — `test_dlpack.py::TestDLPack::test_invaid_stream[scalar|dictionary|device]`** coverage.py 7.9+ makes the `sys.monitoring` core (`sysmon`) the default on python 3.14. That core (a) does not support plugins such as the `Cython.Coverage` plugin used here, and (b) corrupts the pending exception when a C/Cython function raises — turning dpctl's correct `TypeError` from `usm_ndarray.__dlpack__` into a `SystemError`, so `assert_raises(TypeError, ...)` fails. Pinned the measurement core back to `ctrace` via `core = "ctrace"` in `[tool.coverage.run]` (`pyproject.toml`). `ctrace` supports both the Cython plugin and branch coverage, so no coverage data is lost.
1 parent 0d7ba8a commit 3a91802

9 files changed

Lines changed: 14 additions & 6 deletions

File tree

.github/workflows/check-onemath.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
strategy:
7171
fail-fast: false
7272
matrix:
73-
python: ['3.13'] # no dpctl package on PyPI with enabled python 3.14 support
73+
python: ['3.14']
7474
os: [ubuntu-latest] # windows-2022 - no DFT support for Windows in oneMKL
7575

7676
runs-on: ${{ matrix.os }}
@@ -187,7 +187,7 @@ jobs:
187187
strategy:
188188
fail-fast: false
189189
matrix:
190-
python: ['3.13'] # no dpctl package on PyPI with enabled python 3.14 support
190+
python: ['3.14']
191191
os: [ubuntu-latest] # windows-2022 - no DFT support for Windows in oneMKL
192192

193193
runs-on: ${{ matrix.os }}

.github/workflows/conda-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ jobs:
659659
dpnp-repo-path: '${{ github.workspace }}/source/'
660660
array-api-skips-file: '${{ github.workspace }}/source/.github/workflows/array-api-skips.txt'
661661
create-conda-channel-env: 'source/environments/create_conda_channel.yml'
662-
python-ver: '3.13' # it has to be aligned with python in create_conda_channel.yml
662+
python-ver: '3.14'
663663
conda-env-name: 'array-api-conformity'
664664
channel-path: '${{ github.workspace }}/channel/'
665665
pkg-path-in-channel: '${{ github.workspace }}/channel/linux-64/'

dpnp/tensor/_slicing.pyx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
# distutils: language = c++
3030
# cython: language_level=3
31+
# cython: linetrace=True
3132

3233
from operator import index
3334
from cpython.buffer cimport PyObject_CheckBuffer

dpnp/tensor/_stride_utils.pyx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
# distutils: language = c++
3030
# cython: language_level=3
31+
# cython: linetrace=True
3132

3233
from cpython.mem cimport PyMem_Free, PyMem_Malloc
3334
from cpython.ref cimport Py_INCREF

dpnp/tensor/_types.pyx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
# distutils: language = c++
3030
# cython: language_level=3
31+
# cython: linetrace=True
3132

3233
import numpy as np
3334

environments/building_docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Building docs specific packages
22
channels:
33
- conda-forge
44
dependencies:
5-
- python=3.13 # no dpctl package on PyPI with enabled python 3.14 support
5+
- python=3.14
66
- cupy
77
- sphinx
88
- furo

environments/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Coverage specific packages
22
channels:
33
- conda-forge
44
dependencies:
5-
- python=3.12 # no python 3.13 support by coveralls
5+
- python=3.14
66
- coverage[toml]
77
- llvm
88
- pytest-cov

environments/upload_cleanup_conda_pkg.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ name: Upload or clean up a conda package
22
channels:
33
- conda-forge
44
dependencies:
5-
- python=3.13
5+
- python=3.14
66
- anaconda-client=1.14.1

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ omit = [
121121

122122
[tool.coverage.run]
123123
branch = true
124+
# Pin the C trace core. On Python 3.14+ coverage.py defaults to the sys.monitoring
125+
# ("sysmon") core, which (1) does not support plugins such as Cython.Coverage below,
126+
# and (2) corrupts the exception state when a C/Cython function raises, turning
127+
# expected exceptions into SystemError (e.g. usm_ndarray.__dlpack__ in test_dlpack.py).
128+
core = "ctrace"
124129
omit = [
125130
"dpnp/tests/*",
126131
"dpnp/_version.py"

0 commit comments

Comments
 (0)