1{
2 lib,
3 buildPythonPackage,
4 cython,
5 fetchPypi,
6 numpy,
7 packaging,
8 pandas,
9 patsy,
10 pythonOlder,
11 scipy,
12 setuptools,
13 setuptools-scm,
14 stdenv,
15}:
16
17buildPythonPackage rec {
18 pname = "statsmodels";
19 version = "0.14.2";
20 pyproject = true;
21
22 disabled = pythonOlder "3.8";
23
24 src = fetchPypi {
25 inherit pname version;
26 hash = "sha256-iQVQFHrTqBzaJPC6GlxAIa3BYBCAvQDhka581v7s1q0=";
27 };
28
29 postPatch = ''
30 substituteInPlace pyproject.toml \
31 --replace-fail "numpy>=2.0.0rc1,<3" "numpy"
32 '';
33
34 build-system = [
35 cython
36 numpy
37 scipy
38 setuptools
39 setuptools-scm
40 ];
41
42 env = lib.optionalAttrs stdenv.cc.isClang {
43 NIX_CFLAGS_COMPILE = toString [
44 "-Wno-error=implicit-function-declaration"
45 "-Wno-error=int-conversion"
46 ];
47 };
48
49 dependencies = [
50 numpy
51 packaging
52 pandas
53 patsy
54 scipy
55 ];
56
57 # Huge test suites with several test failures
58 doCheck = false;
59
60 pythonImportsCheck = [ "statsmodels" ];
61
62 meta = with lib; {
63 description = "Statistical computations and models for use with SciPy";
64 homepage = "https://www.github.com/statsmodels/statsmodels";
65 changelog = "https://github.com/statsmodels/statsmodels/releases/tag/v${version}";
66 license = licenses.bsd3;
67 };
68}