From c5d63dbc03489e8bdc3a0ddc31a28bf1009f33fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Fri, 20 Mar 2026 13:14:28 -0700 Subject: [PATCH] python3Packages.arch: fix build failure --- .../python-modules/arch/default.nix | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/arch/default.nix b/pkgs/development/python-modules/arch/default.nix index 4362bbaa62c7..6614d78c7f67 100644 --- a/pkgs/development/python-modules/arch/default.nix +++ b/pkgs/development/python-modules/arch/default.nix @@ -1,6 +1,7 @@ { lib, buildPythonPackage, + python, fetchFromGitHub, cython, numpy, @@ -8,9 +9,9 @@ property-cached, pytestCheckHook, scipy, - setuptools, setuptools-scm, statsmodels, + meson-python, }: buildPythonPackage rec { @@ -25,17 +26,10 @@ buildPythonPackage rec { hash = "sha256-qw8sSgsMu6YTiQlzsrePnDKkFBtrxD9RK6ZZE5jFeX0="; }; - postPatch = '' - substituteInPlace setup.cfg \ - --replace-fail 'PytestRemovedIn8Warning' 'PytestRemovedIn9Warning' - substituteInPlace pyproject.toml \ - --replace-fail '"setuptools_scm[toml]>=8.0.3,<9",' '"setuptools_scm[toml]",' - ''; - build-system = [ - setuptools setuptools-scm cython + meson-python ]; dependencies = [ @@ -48,6 +42,16 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook ]; + # Replace the source tree's arch/ with symlinks to the installed package. + # pytest adds rootdir to sys.path, so the source arch/ always shadows the + # installed one. The source tree lacks _version.py (generated by setuptools-scm) + # and compiled Cython extensions, causing import failures. + # Symlinking to the installed package makes all imports resolve correctly. + preCheck = '' + rm -rf arch + ln -s $out/${python.sitePackages}/arch arch + ''; + disabledTestPaths = [ # Skip long-running/failing tests "arch/tests/univariate/test_forecast.py"