From 2633167c2b10ae2a01dcb4813b48bc5a6779acd5 Mon Sep 17 00:00:00 2001
From: Dmitry Vyal <dmitryvyal@gmail.com>
Date: Fri, 4 Jan 2019 11:53:36 +0300
Subject: [PATCH 1/3] added akamaus to maintainers-list

---
 maintainers/maintainer-list.nix | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index 1830d7087e6..a0dda6f5c43 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -283,6 +283,12 @@
     githubId = 273837;
     name = "Mateusz CzapliƄski";
   };
+  akamaus = {
+    email = "dmitryvyal@gmail.com";
+    github = "akamaus";
+    githubId = 58955;
+    name = "Dmitry Vyal";
+  };
   akaWolf = {
     email = "akawolf0@gmail.com";
     github = "akaWolf";

From 9c86c74cd6d9c4d823fee86d5ce5889dd8320897 Mon Sep 17 00:00:00 2001
From: Dmitry Vyal <dmitryvyal@gmail.com>
Date: Sat, 5 Jan 2019 00:20:43 +0300
Subject: [PATCH 2/3] pythonPackages.tensorboardx: init at 2.0

---
 .../python-modules/tensorboardx/default.nix   | 32 +++++++++++++++++++
 pkgs/top-level/python-packages.nix            |  2 ++
 2 files changed, 34 insertions(+)
 create mode 100644 pkgs/development/python-modules/tensorboardx/default.nix

diff --git a/pkgs/development/python-modules/tensorboardx/default.nix b/pkgs/development/python-modules/tensorboardx/default.nix
new file mode 100644
index 00000000000..3c9c9f5c898
--- /dev/null
+++ b/pkgs/development/python-modules/tensorboardx/default.nix
@@ -0,0 +1,32 @@
+{ boto3, buildPythonPackage, crc32c, fetchFromGitHub, lib, matplotlib, moto,
+  numpy, pillow, pytorch, protobuf, six, pytest,
+  tensorflow-tensorboard, torchvision }:
+
+buildPythonPackage rec {
+  pname = "tensorboardx";
+  version = "2.0";
+
+  src = fetchFromGitHub {
+    owner = "lanpa";
+    repo = "tensorboardX";
+    rev = "v${version}";
+    sha256 = "0qqalq0fhbx0wnd8wdwhyhkkv2brvj9qbk3373vk3wjxbribf5c7";
+  };
+
+  checkInputs = [ boto3 crc32c matplotlib moto pillow pytorch pytest tensorflow-tensorboard torchvision ];
+
+  propagatedBuildInputs = [ numpy protobuf six ];
+
+  postPatch = ''
+    substituteInPlace tests/test_visdom.py --replace test_TorchVis _skip_test_TorchVis
+    substituteInPlace tests/test_onnx_graph.py --replace test_onnx_graph _skip_test_onnx_graph
+  '';
+
+  meta = with lib; {
+    description = "Library for writing tensorboard-compatible logs";
+    homepage = "https://github.com/lanpa/tensorboard-pytorch";
+    license = licenses.mit;
+    maintainers = with maintainers; [ lebastr akamaus ];
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 47e0317a3f9..4c427591167 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -7238,6 +7238,8 @@ in {
 
   suseapi = callPackage ../development/python-modules/suseapi { };
 
+  tensorboardx = callPackage ../development/python-modules/tensorboardx { };
+
   typed-ast = callPackage ../development/python-modules/typed-ast { };
 
   stripe = callPackage ../development/python-modules/stripe { };

From 0c5e60202961ccea1c8ad8ac1201998e37f0791c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Tue, 30 Jun 2020 08:59:39 +0100
Subject: [PATCH 3/3] tensorboardx: use pytestCheckHook

---
 .../python-modules/tensorboardx/default.nix     | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/pkgs/development/python-modules/tensorboardx/default.nix b/pkgs/development/python-modules/tensorboardx/default.nix
index 3c9c9f5c898..d2532777d00 100644
--- a/pkgs/development/python-modules/tensorboardx/default.nix
+++ b/pkgs/development/python-modules/tensorboardx/default.nix
@@ -1,6 +1,6 @@
-{ boto3, buildPythonPackage, crc32c, fetchFromGitHub, lib, matplotlib, moto,
-  numpy, pillow, pytorch, protobuf, six, pytest,
-  tensorflow-tensorboard, torchvision }:
+{ boto3, buildPythonPackage, crc32c, fetchFromGitHub, lib, matplotlib, moto
+, numpy, pillow, pytorch, protobuf, six, pytestCheckHook
+, tensorflow-tensorboard, torchvision }:
 
 buildPythonPackage rec {
   pname = "tensorboardx";
@@ -13,18 +13,17 @@ buildPythonPackage rec {
     sha256 = "0qqalq0fhbx0wnd8wdwhyhkkv2brvj9qbk3373vk3wjxbribf5c7";
   };
 
-  checkInputs = [ boto3 crc32c matplotlib moto pillow pytorch pytest tensorflow-tensorboard torchvision ];
+  checkInputs = [
+    pytestCheckHook boto3 crc32c matplotlib moto pillow pytorch tensorflow-tensorboard torchvision
+  ];
 
   propagatedBuildInputs = [ numpy protobuf six ];
 
-  postPatch = ''
-    substituteInPlace tests/test_visdom.py --replace test_TorchVis _skip_test_TorchVis
-    substituteInPlace tests/test_onnx_graph.py --replace test_onnx_graph _skip_test_onnx_graph
-  '';
+  disabledTests = [ "test_TorchVis"  "test_onnx_graph" ];
 
   meta = with lib; {
     description = "Library for writing tensorboard-compatible logs";
-    homepage = "https://github.com/lanpa/tensorboard-pytorch";
+    homepage = "https://github.com/lanpa/tensorboardX";
     license = licenses.mit;
     maintainers = with maintainers; [ lebastr akamaus ];
     platforms = platforms.all;