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.2.240909";
40 pyproject = true;
41
42 disabled = pythonOlder "3.10";
43
44 src = fetchFromGitHub {
45 owner = "pandas-dev";
46 repo = "pandas-stubs";
47 rev = "refs/tags/v${version}";
48 hash = "sha256-Dt2a4l5WAOizUeaDa80CRuvyPT9mWfFz+zGZMm3vQP4=";
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 [
82 # Missing dependencies, error and warning checks
83 "test_all_read_without_lxml_dtype_backend" # pyarrow.orc
84 "test_orc" # pyarrow.orc
85 "test_plotting" # UserWarning: No artists with labels found to put in legend.
86 "test_spss" # FutureWarning: ChainedAssignmentError: behaviour will change in pandas 3.0!
87 "test_show_version"
88 # FutureWarning: In the future `np.bool` will be defined as the corresponding...
89 "test_timedelta_cmp"
90 "test_timestamp_cmp"
91 ]
92 ++ lib.optionals stdenv.hostPlatform.isDarwin [
93 "test_clipboard" # FileNotFoundError: [Errno 2] No such file or directory: 'pbcopy'
94 ]
95 ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
96 # Disable tests for types that are not supported on aarch64 in `numpy` < 2.0
97 "test_astype_float" # `f16` and `float128`
98 "test_astype_complex" # `c32` and `complex256`
99 ];
100
101 pythonImportsCheck = [ "pandas" ];
102
103 meta = with lib; {
104 description = "Type annotations for Pandas";
105 homepage = "https://github.com/pandas-dev/pandas-stubs";
106 license = licenses.mit;
107 maintainers = with maintainers; [ malo ];
108 };
109}