Files
nixpkgs/pkgs/development/python-modules/kaggle/default.nix
2026-06-28 18:41:59 +00:00

76 lines
1.5 KiB
Nix

{
bleach,
buildPythonPackage,
fetchFromGitHub,
hatchling,
jupytext,
kagglesdk,
lib,
packaging,
protobuf,
python-dateutil,
python-dotenv,
python-slugify,
pytestCheckHook,
requests,
six,
tqdm,
urllib3,
writableTmpDirAsHomeHook,
}:
buildPythonPackage (finalAttrs: {
__structuredAttrs = true;
pname = "kaggle";
version = "2.2.3";
pyproject = true;
src = fetchFromGitHub {
owner = "Kaggle";
repo = "kaggle-cli";
tag = "v${finalAttrs.version}";
hash = "sha256-NvSR3kSncBtjj2zuwESGXRMbZofYcnRnXIglRJ3dsrQ=";
};
build-system = [ hatchling ];
dependencies = [
bleach
jupytext
kagglesdk
packaging
protobuf
python-dateutil
python-dotenv
python-slugify
requests
six
tqdm
urllib3
];
nativeCheckInputs = [
pytestCheckHook
# kaggle creates its config dir at import time; needs a writable HOME.
writableTmpDirAsHomeHook
];
# kaggle authenticates at import time; fake creds for the offline checks.
env = {
KAGGLE_USERNAME = "nixos-test";
KAGGLE_KEY = "00000000000000000000000000000000";
};
pythonImportsCheck = [ "kaggle" ];
meta = {
description = "Official Kaggle CLI";
mainProgram = "kaggle";
homepage = "https://github.com/Kaggle/kaggle-cli";
changelog = "https://github.com/Kaggle/kaggle-cli/blob/v${finalAttrs.version}/CHANGELOG.md";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ daniel-fahey ];
};
})