Files
nixpkgs/pkgs/development/python-modules/bittensor/default.nix
2026-10-30 18:06:24 +00:00

75 lines
1.5 KiB
Nix

{
lib,
buildPythonPackage,
fetchPypi,
pythonOlder,
hatchling,
bittensor-core,
eth-account,
qrcode,
rich,
typer,
typing-extensions,
websockets,
cryptography,
hypothesis,
pytest-asyncio,
pytestCheckHook,
versionCheckHook,
writableTmpDirAsHomeHook,
}:
buildPythonPackage (finalAttrs: {
pname = "bittensor";
version = "11.1.0";
pyproject = true;
src = fetchPypi {
inherit (finalAttrs) pname version;
hash = "sha256-l75+nVI8o22T7dx7ljGLQqe72VErU8dXxYB6fa+0Nx0=";
};
pythonRelaxDeps = [ "websockets" ];
build-system = [ hatchling ];
dependencies = [
bittensor-core
eth-account
qrcode
rich
typer
websockets
]
++ lib.optionals (pythonOlder "3.11") [ typing-extensions ];
nativeCheckInputs = [
cryptography
hypothesis
pytest-asyncio
pytestCheckHook
versionCheckHook
writableTmpDirAsHomeHook
];
versionCheckProgramArg = "--version";
pythonImportsCheck = [ "bittensor" ];
disabledTests = [
# InvalidHeaderValue
"test_handshake_diagnostics_strip_terminal_controls"
];
__darwinAllowLocalNetworking = true;
meta = {
description = "Python SDK and command line client for the Bittensor chain";
homepage = "https://github.com/RaoFoundation/subtensor";
changelog = "https://pypi.org/project/bittensor/${finalAttrs.version}/";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ kilyanni ];
mainProgram = "btcli";
};
})