about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pandas-stubs/default.nix
blob: 843ae520be02e91fcfa77cb12849a53503cd8c15 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
{
  lib,
  stdenv,
  buildPythonPackage,
  pythonOlder,
  fetchFromGitHub,

  # build-system
  poetry-core,

  # dependencies
  numpy,
  types-pytz,

  # tests
  pytestCheckHook,
  beautifulsoup4,
  html5lib,
  jinja2,
  lxml,
  matplotlib,
  odfpy,
  openpyxl,
  pandas,
  pyarrow,
  pyreadstat,
  scipy,
  sqlalchemy,
  tables,
  tabulate,
  typing-extensions,
  xarray,
  xlsxwriter,
}:

buildPythonPackage rec {
  pname = "pandas-stubs";
  version = "2.2.2.240603";
  pyproject = true;

  disabled = pythonOlder "3.9";

  src = fetchFromGitHub {
    owner = "pandas-dev";
    repo = "pandas-stubs";
    rev = "refs/tags/v${version}";
    hash = "sha256-wJ7lN1+BGNqhwgPLmmpb3foX6rIEy3R62rOvu0mr8xs=";
  };

  build-system = [ poetry-core ];

  dependencies = [
    numpy
    types-pytz
  ];

  nativeCheckInputs = [
    pytestCheckHook
    beautifulsoup4
    html5lib
    jinja2
    lxml
    matplotlib
    odfpy
    openpyxl
    pandas
    pyarrow
    pyreadstat
    scipy
    sqlalchemy
    tables
    tabulate
    typing-extensions
    xarray
    xlsxwriter

    # missing dependencies in nixpkgs
    # python-calamine
  ];

  disabledTests =
    [
      # Missing dependencies, error and warning checks
      "test_all_read_without_lxml_dtype_backend" # pyarrow.orc
      "test_orc" # pyarrow.orc
      "test_read_excel" # python-calamine
      "test_plotting" # UserWarning: No artists with labels found to put in legend.
      "test_spss" # FutureWarning: ChainedAssignmentError: behaviour will change in pandas 3.0!
      "test_show_version"
    ]
    ++ lib.optionals stdenv.isDarwin [
      "test_clipboard" # FileNotFoundError: [Errno 2] No such file or directory: 'pbcopy'
    ]
    ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
      # Disable tests for types that are not supported on aarch64 in `numpy` < 2.0
      "test_astype_float" # `f16` and `float128`
      "test_astype_complex" # `c32` and `complex256`
    ];

  pythonImportsCheck = [ "pandas" ];

  meta = with lib; {
    description = "Type annotations for Pandas";
    homepage = "https://github.com/pandas-dev/pandas-stubs";
    license = licenses.mit;
    maintainers = with maintainers; [ malo ];
  };
}