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