From 918af2267ec06e5e95ec6dfc610de5d1fcf9065f Mon Sep 17 00:00:00 2001
From: Chris Ostrouchov <chris.ostrouchov@gmail.com>
Date: Tue, 16 Oct 2018 16:04:36 -0400
Subject: [PATCH] pythonPackages.hug: refactor move to python-modules

---
 .../python-modules/hug/default.nix            | 30 +++++++++++++++++++
 pkgs/top-level/python-packages.nix            | 20 +------------
 2 files changed, 31 insertions(+), 19 deletions(-)
 create mode 100644 pkgs/development/python-modules/hug/default.nix

diff --git a/pkgs/development/python-modules/hug/default.nix b/pkgs/development/python-modules/hug/default.nix
new file mode 100644
index 00000000000..4aeffc75823
--- /dev/null
+++ b/pkgs/development/python-modules/hug/default.nix
@@ -0,0 +1,30 @@
+{ stdenv
+, buildPythonPackage
+, fetchPypi
+, isPy27
+, falcon
+, requests
+}:
+
+buildPythonPackage rec {
+  pname = "hug";
+  version = "2.1.2";
+  disabled = isPy27;
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "93325e13706594933a9afb0d4f0b0748134494299038f07df41152baf6f89f4c";
+  };
+
+  propagatedBuildInputs = [ falcon requests ];
+
+  # tests are not shipped in the tarball
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    description = "A Python framework that makes developing APIs as simple as possible, but no simpler";
+    homepage = https://github.com/timothycrosley/hug;
+    license = licenses.mit;
+  };
+
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index c7cc5e7fbdd..2a13c1421cf 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -2286,25 +2286,7 @@ in {
 
   falcon = callPackage ../development/python-modules/falcon { };
 
-  hug = buildPythonPackage rec {
-    name = "hug-2.1.2";
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/h/hug/${name}.tar.gz";
-      sha256 = "93325e13706594933a9afb0d4f0b0748134494299038f07df41152baf6f89f4c";
-    };
-    disabled = !isPy3k;
-
-    propagatedBuildInputs = with self; [ falcon requests ];
-
-    # tests are not shipped in the tarball
-    doCheck = false;
-
-    meta = {
-      description = "A Python framework that makes developing APIs as simple as possible, but no simpler";
-      homepage = https://github.com/timothycrosley/hug;
-      license = licenses.mit;
-    };
-  };
+  hug = callPackage ../development/python-modules/hug { };
 
   flup = callPackage ../development/python-modules/flup { };