1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 pythonOlder,
6 fetchFromGitHub,
7
8 # build-system
9 poetry-core,
10
11 # dependencies
12 numpy,
13 types-pytz,
14
15 # tests
16 pytestCheckHook,
17 beautifulsoup4,
18 html5lib,
19 jinja2,
20 lxml,
21 matplotlib,
22 odfpy,
23 openpyxl,
24 pandas,
25 pyarrow,
26 pyreadstat,
27 python-calamine,
28 scipy,
29 sqlalchemy,
30 tables,
31 tabulate,
32 typing-extensions,
33 xarray,
34 xlsxwriter,
35}:
36
37buildPythonPackage rec {
38 pname = "pandas-stubs";
39 version = "2.2.3.250308";
40 pyproject = true;
41
42 disabled = pythonOlder "3.10";
43
44 src = fetchFromGitHub {
45 owner = "pandas-dev";
46 repo = "pandas-stubs";
47 tag = "v${version}";
48 hash = "sha256-93XVzdb3A2S+Exk33v3U8HDMg9vPKAEkWjLZnBaXMWQ=";
49 };
50
51 build-system = [ poetry-core ];
52
53 dependencies = [
54 numpy
55 types-pytz
56 ];
57
58 nativeCheckInputs = [
59 pytestCheckHook
60 beautifulsoup4
61 html5lib
62 jinja2
63 lxml
64 matplotlib
65 odfpy
66 openpyxl
67 pandas
68 pyarrow
69 pyreadstat
70 scipy
71 sqlalchemy
72 tables
73 tabulate
74 typing-extensions
75 xarray
76 xlsxwriter
77 python-calamine
78 ];
79
80 disabledTests = [
81 # Missing dependencies, error and warning checks
82 "test_all_read_without_lxml_dtype_backend" # pyarrow.orc
83 "test_orc" # pyarrow.orc
84 "test_plotting" # UserWarning: No artists with labels found to put in legend.
85 "test_spss" # FutureWarning: ChainedAssignmentError: behaviour will change in pandas 3.0!
86 "test_show_version"
87 # FutureWarning: In the future `np.bool` will be defined as the corresponding...
88 "test_timedelta_cmp"
89 "test_timestamp_cmp"
90 ]
91 ++ lib.optionals stdenv.hostPlatform.isDarwin [
92 "test_clipboard" # FileNotFoundError: [Errno 2] No such file or directory: 'pbcopy'
93 ]
94 ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
95 # Disable tests for types that are not supported on aarch64 in `numpy` < 2.0
96 "test_astype_float" # `f16` and `float128`
97 "test_astype_complex" # `c32` and `complex256`
98 ];
99
100 pythonImportsCheck = [ "pandas" ];
101
102 meta = with lib; {
103 description = "Type annotations for Pandas";
104 homepage = "https://github.com/pandas-dev/pandas-stubs";
105 license = licenses.mit;
106 maintainers = with maintainers; [ malo ];
107 };
108}