{ lib, buildPythonPackage, python, fetchFromGitHub, cython, numpy, pandas, property-cached, pytestCheckHook, scipy, setuptools-scm, statsmodels, meson-python, }: buildPythonPackage rec { pname = "arch"; version = "8.0.0"; pyproject = true; src = fetchFromGitHub { owner = "bashtage"; repo = "arch"; tag = "v${version}"; hash = "sha256-qw8sSgsMu6YTiQlzsrePnDKkFBtrxD9RK6ZZE5jFeX0="; }; build-system = [ setuptools-scm cython meson-python ]; dependencies = [ numpy pandas property-cached scipy statsmodels ]; 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" "arch/tests/univariate/test_mean.py" ]; pythonImportsCheck = [ "arch" ]; meta = { description = "Autoregressive Conditional Heteroskedasticity (ARCH) and other tools for financial econometrics"; homepage = "https://github.com/bashtage/arch"; changelog = "https://github.com/bashtage/arch/releases/tag/${src.tag}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ jherland ]; }; }