ports/pythonPorts-as-overlay.nix
Convert pythonPorts.nix list to packageOverrides function
Import pyports.nix - returns a list of port specs
Convert list to attrset keyed by pname (same logic as ports2-as-overlay)
Test suites run under the Fil-C interpreter (pytestCheckHook is not spliced), but nativeCheckInputs resolve to the build platform's Python set, whose extension modules Fil-C Python cannot load (fonttools failed importing a glibc build of zopfli). Take Python modules among the check inputs from the host set; other check tools and all build tools stay native. An overrideAttrs that adds check inputs later bypasses this.
Only for the packages listed here: made global, every check module's runtime closure became a tested Fil-C build (httpcore importing a native rpds, faust-cchardet's C++ against Fil-C's internal headers, ...).
Rust has no Fil-C target, so a module that is (or requires) a Cargo build stays native, as all check modules were before.
Python also forwards packageOverrides to its build-platform interpreter. Splice test inputs only for Fil-C; individual ports can opt out on native.
These overrides also reach the build platform's Python.
Custom Python package (not in pyprev)