1{ boto3 2, buildPythonPackage 3, crc32c 4, fetchFromGitHub 5, lib 6, matplotlib 7, moto 8, numpy 9, protobuf 10, pytestCheckHook 11, torch 12, setuptools-scm 13, soundfile 14, stdenv 15, tensorboard 16, torchvision 17}: 18 19buildPythonPackage rec { 20 pname = "tensorboardx"; 21 version = "2.6.2"; 22 format = "setuptools"; 23 24 src = fetchFromGitHub { 25 owner = "lanpa"; 26 repo = "tensorboardX"; 27 rev = "refs/tags/v${version}"; 28 hash = "sha256-m7RLDOMuRNLacnIudptBGjhcTlMk8+v/onz6Amqxb90="; 29 }; 30 31 nativeBuildInputs = [ 32 protobuf 33 setuptools-scm 34 ]; 35 36 # required to make tests deterministic 37 env.PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION = "python"; 38 39 env.SETUPTOOLS_SCM_PRETEND_VERSION = version; 40 41 propagatedBuildInputs = [ 42 crc32c 43 numpy 44 ]; 45 46 pythonImportsCheck = [ "tensorboardX" ]; 47 48 nativeCheckInputs = [ 49 boto3 50 matplotlib 51 moto 52 pytestCheckHook 53 soundfile 54 torch 55 tensorboard 56 torchvision 57 ]; 58 59 disabledTests = [ 60 # ImportError: Visdom visualization requires installation of Visdom 61 "test_TorchVis" 62 # Requires network access (FileNotFoundError: [Errno 2] No such file or directory: 'wget') 63 "test_onnx_graph" 64 ] ++ lib.optionals stdenv.isDarwin [ 65 # Fails with a mysterious error in pytorch: 66 # RuntimeError: required keyword attribute 'name' has the wrong type 67 "test_pytorch_graph" 68 ]; 69 70 disabledTestPaths = [ 71 # we are not interested in linting errors 72 "tests/test_lint.py" 73 ]; 74 75 meta = with lib; { 76 description = "Library for writing tensorboard-compatible logs"; 77 homepage = "https://tensorboardx.readthedocs.io"; 78 downloadPage = "https://github.com/lanpa/tensorboardX"; 79 changelog = "https://github.com/lanpa/tensorboardX/blob/${src.rev}/HISTORY.rst"; 80 license = licenses.mit; 81 maintainers = with maintainers; [ lebastr akamaus ]; 82 platforms = platforms.all; 83 }; 84}