Repository navigation
93 lines (84 loc) · 2.89 KB
/
Copy pathbuild_pip.yml
File metadata and controls
93 lines (84 loc) · 2.89 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Editable build using pip and pre-release NumPy
on:
push:
branches:
- master
pull_request:
permissions:
contents: read
jobs:
build:
name: build (${{ matrix.python_tag || matrix.python }}${{ matrix.use_pre != '' && ', pre' || '' }})
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
strategy:
matrix:
python: ["3.10", "3.11", "3.12", "3.13"]
use_pre: ["", "--pre"]
include:
- python: "3.14"
python_tag: "3.14"
python_spec: "3.14.* *_cp314"
use_pre: ""
- python: "3.14"
python_tag: "3.14"
python_spec: "3.14.* *_cp314"
use_pre: "--pre"
- python: "3.14"
python_tag: "3.14t"
python_spec: "3.14.* *_cp314t"
free_threaded: "true"
use_pre: ""
- python: "3.14"
python_tag: "3.14t"
python_spec: "3.14.* *_cp314t"
free_threaded: "true"
use_pre: "--pre"
- python: "3.15"
python_tag: "3.15"
python_spec: "3.15.* *_cp315"
use_pre: ""
- python: "3.15"
python_tag: "3.15"
python_spec: "3.15.* *_cp315"
use_pre: "--pre"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: 0
- uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0
with:
miniforge-version: latest
channels: conda-forge
activate-environment: test
python-version: ${{ matrix.python }}
- name: Install MKL
run: |
conda install mkl-devel "python=${{ matrix.python_spec || matrix.python }}"
- name: Verify GIL vs free-threaded ABI
env:
EXPECT_FREE_THREADED: ${{ matrix.free_threaded || '' }}
run: |
python - <<'PY'
import os, sys, sysconfig
gil_disabled = bool(sysconfig.get_config_var("Py_GIL_DISABLED"))
expected = bool(os.environ.get("EXPECT_FREE_THREADED"))
assert gil_disabled == expected, (
f"ABI mismatch: Py_GIL_DISABLED={gil_disabled}, expected "
f"free-threaded={expected}; the conda ABI swap did not take effect"
)
if expected:
assert not sys._is_gil_enabled(), "GIL re-enabled on free-threaded build"
print(f"OK: Py_GIL_DISABLED={gil_disabled}")
PY
- name: Build with pip
run: |
pip install --no-cache-dir meson-python ninja cmake "cython>=3.1.0"
pip install --no-cache-dir numpy ${{ matrix.use_pre }}
pip install -e . --no-build-isolation --no-deps --verbose
pip install --no-cache-dir pytest
pip list
python -m pytest -v mkl_random/tests