7373 artifact : linux-x86_64
7474 - os : macos-15
7575 artifact : macos-aarch64
76- - os : windows-2025
77- artifact : windows-x86_64
7876
7977 steps :
8078 - uses : actions/checkout@v7
@@ -101,14 +99,19 @@ jobs:
10199 uv sync --group dev --python "${python_version}"
102100 uv run --python "${python_version}" maturin develop
103101
104- if [[ "${RUNNER_OS}" == "Windows" ]]; then
105- uv run --python "${python_version}" python -c "import pynumaflow_lite; from pynumaflow_lite import mapper; print('pynumaflow-lite import ok')"
106- else
107- uv run --python "${python_version}" pytest -v
108- export PYTHONHOME="$(uv run --python "${python_version}" python -c 'import sys; print(sys.base_prefix)')"
109- cargo test
110- unset PYTHONHOME
111- fi
102+ uv run --python "${python_version}" pytest -v
103+
104+ # cargo test embeds a Python interpreter via pyo3 (Python::initialize).
105+ # pyo3's build script must link against the same uv-managed interpreter
106+ # (PYO3_PYTHON), and the embedded interpreter must locate its stdlib at
107+ # runtime (PYTHONHOME = that interpreter's base_prefix). Pinning only one
108+ # of the two leaves the linked libpython and the stdlib mismatched, which
109+ # surfaces as "init_fs_encoding: No module named 'encodings'".
110+ python_bin="$(uv run --python "${python_version}" python -c 'import sys; print(sys.executable)')"
111+ export PYO3_PYTHON="${python_bin}"
112+ export PYTHONHOME="$("${python_bin}" -c 'import sys; print(sys.base_prefix)')"
113+ cargo test
114+ unset PYO3_PYTHON PYTHONHOME
112115
113116 unset UV_PYTHON
114117 echo "::endgroup::"
@@ -137,11 +140,6 @@ jobs:
137140 artifact : macos-aarch64
138141 manylinux : " off"
139142 linux : false
140- - os : windows-2025
141- target : x86_64-pc-windows-msvc
142- artifact : windows-x86_64
143- manylinux : " off"
144- linux : false
145143
146144 steps :
147145 - uses : actions/checkout@v7
0 commit comments