From 79112e85225cab9f2a4b1d08b5bef78d2279a92d Mon Sep 17 00:00:00 2001
From: Chris Ostrouchov <chris.ostrouchov@gmail.com>
Date: Mon, 29 Oct 2018 09:27:06 -0400
Subject: [PATCH] pythonPackages.vmprof: refactor move to python-modules

---
 .../python-modules/vmprof/default.nix         | 28 +++++++++++++++++++
 pkgs/top-level/python-packages.nix            | 23 +--------------
 2 files changed, 29 insertions(+), 22 deletions(-)
 create mode 100644 pkgs/development/python-modules/vmprof/default.nix

diff --git a/pkgs/development/python-modules/vmprof/default.nix b/pkgs/development/python-modules/vmprof/default.nix
new file mode 100644
index 000000000000..9a9693d770e7
--- /dev/null
+++ b/pkgs/development/python-modules/vmprof/default.nix
@@ -0,0 +1,28 @@
+{ stdenv
+, buildPythonPackage
+, fetchPypi
+, requests
+, six
+}:
+
+buildPythonPackage rec {
+  version = "0.3.3";
+  pname = "vmprof";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "991bc2f1dc824c63e9b399f9e8606deded92a52378d0e449f258807d7556b039";
+  };
+
+  propagatedBuildInputs = [ requests six];
+
+  # No tests included
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    description = "A vmprof client";
+    license = licenses.mit;
+    homepage = https://vmprof.readthedocs.org/;
+  };
+
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 8702d880f0d5..63df7057691b 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -4091,28 +4091,7 @@ in {
 
   virtualenvwrapper = callPackage ../development/python-modules/virtualenvwrapper { };
 
-  vmprof = buildPythonPackage rec {
-    version = "0.3.3";
-    name = "vmprof-${version}";
-
-    # Url using old scheme doesn't seem to work
-    src = pkgs.fetchurl {
-      url = "https://files.pythonhosted.org/packages/c3/f3/f039ca77e727c5c2d3e61967a2a5c9ecc0ef6ca235012fd5559febb77cd0/vmprof-0.3.3.tar.gz";
-      sha256 = "991bc2f1dc824c63e9b399f9e8606deded92a52378d0e449f258807d7556b039";
-    };
-
-    propagatedBuildInputs = with self; [ requests six];
-
-    # No tests included
-    doCheck = false;
-
-    meta = {
-      description = "A vmprof client";
-      license = licenses.mit;
-      homepage = https://vmprof.readthedocs.org/;
-    };
-
-  };
+  vmprof = callPackage ../development/python-modules/vmprof { };
 
   vultr = buildPythonPackage rec {
     version = "0.1.2";