1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6 pytestCheckHook,
7 beartype,
8 invoke,
9 numpy,
10 pandas,
11 feedparser,
12}:
13
14buildPythonPackage rec {
15 pname = "nptyping";
16 version = "2.5.0";
17 format = "setuptools";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "ramonhagenaars";
23 repo = "nptyping";
24 tag = "v${version}";
25 hash = "sha256-hz4YrcvARCAA7TXapmneIwle/F4pzcIYLPSmiFHC0VQ=";
26 };
27
28 patches = [
29 ./numpy-2.0-compat.patch
30 ];
31
32 propagatedBuildInputs = [ numpy ];
33
34 nativeCheckInputs = [
35 beartype
36 feedparser
37 invoke
38 pandas
39 pytestCheckHook
40 ];
41
42 disabledTests = [
43 # tries to download data
44 "test_pandas_stubs_fork_is_synchronized"
45 ];
46
47 disabledTestPaths = [
48 # missing pyright import:
49 "tests/test_pyright.py"
50 # can't find mypy stubs for pandas:
51 "tests/test_mypy.py"
52 "tests/pandas_/test_mypy_dataframe.py"
53 # typeguard release broke nptyping compatibility:
54 "tests/test_typeguard.py"
55 # tries to build wheel of package, broken/unnecessary under Nix:
56 "tests/test_wheel.py"
57 # beartype fails a type check
58 "tests/test_beartype.py"
59 # broken by patch: https://github.com/ramonhagenaars/nptyping/pull/114#issuecomment-2605786199
60 # can be removed when the patch is merged
61 "tests/test_lib_export.py"
62 ];
63
64 pythonImportsCheck = [ "nptyping" ];
65
66 meta = with lib; {
67 description = "Type hints for numpy";
68 homepage = "https://github.com/ramonhagenaars/nptyping";
69 changelog = "https://github.com/ramonhagenaars/nptyping/blob/v${version}/HISTORY.md";
70 license = licenses.mit;
71 maintainers = with maintainers; [
72 bcdarwin
73 pandapip1
74 ];
75 };
76}