nixpkgs/pkgs/development/python-modules/nptyping/default.nix
Timo Gottszky 5b4f11ff16 python3Packages.nptyping: migrate to pyproject
(cherry picked from commit eab8b58d1c)
2026-06-10 22:04:48 +00:00

78 lines
1.7 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
pytestCheckHook,
setuptools,
beartype,
invoke,
numpy,
pandas,
feedparser,
}:
buildPythonPackage (finalAttrs: {
pname = "nptyping";
version = "2.5.0";
pyproject = true;
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "ramonhagenaars";
repo = "nptyping";
tag = "v${finalAttrs.version}";
hash = "sha256-hz4YrcvARCAA7TXapmneIwle/F4pzcIYLPSmiFHC0VQ=";
};
patches = [
./numpy-2.0-compat.patch
];
build-system = [ setuptools ];
dependencies = [ numpy ];
nativeCheckInputs = [
beartype
feedparser
invoke
pandas
pytestCheckHook
];
disabledTests = [
# tries to download data
"test_pandas_stubs_fork_is_synchronized"
];
disabledTestPaths = [
# missing pyright import:
"tests/test_pyright.py"
# can't find mypy stubs for pandas:
"tests/test_mypy.py"
"tests/pandas_/test_mypy_dataframe.py"
# typeguard release broke nptyping compatibility:
"tests/test_typeguard.py"
# tries to build wheel of package, broken/unnecessary under Nix:
"tests/test_wheel.py"
# beartype fails a type check
"tests/test_beartype.py"
# broken by patch: https://github.com/ramonhagenaars/nptyping/pull/114#issuecomment-2605786199
# can be removed when the patch is merged
"tests/test_lib_export.py"
];
pythonImportsCheck = [ "nptyping" ];
meta = {
description = "Type hints for numpy";
homepage = "https://github.com/ramonhagenaars/nptyping";
changelog = "https://github.com/ramonhagenaars/nptyping/blob/v${finalAttrs.version}/HISTORY.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
bcdarwin
pandapip1
];
};
})