Unverified Commit 424ef1e0 authored by Yohann Boniface's avatar Yohann Boniface Committed by GitHub
Browse files

python3Packages.arch: fix build failure (#501758)

parents 86bb3142 c5d63dbc
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
{
  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"