summary refs log tree commit diff
path: root/pkgs/development/python-modules/publicsuffix
diff options
context:
space:
mode:
authorElis Hirwing <elis@hirwing.se>2018-03-10 08:50:21 +0100
committerElis Hirwing <elis@hirwing.se>2018-03-10 12:07:11 +0100
commit605a373468dcafc0ac4829e2705035efa2583951 (patch)
treeafc25a4796ab2fa6dac295a847d4103708cba8b2 /pkgs/development/python-modules/publicsuffix
parent14464b1dc5aa480e030ef8ba25da1899160e81fb (diff)
downloadnixpkgs-605a373468dcafc0ac4829e2705035efa2583951.tar
nixpkgs-605a373468dcafc0ac4829e2705035efa2583951.tar.gz
nixpkgs-605a373468dcafc0ac4829e2705035efa2583951.tar.bz2
nixpkgs-605a373468dcafc0ac4829e2705035efa2583951.tar.lz
nixpkgs-605a373468dcafc0ac4829e2705035efa2583951.tar.xz
nixpkgs-605a373468dcafc0ac4829e2705035efa2583951.tar.zst
nixpkgs-605a373468dcafc0ac4829e2705035efa2583951.zip
publicsuffix: move to own file and fix homepage
Diffstat (limited to 'pkgs/development/python-modules/publicsuffix')
-rw-r--r--pkgs/development/python-modules/publicsuffix/default.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/publicsuffix/default.nix b/pkgs/development/python-modules/publicsuffix/default.nix
new file mode 100644
index 00000000000..9c90161c6ea
--- /dev/null
+++ b/pkgs/development/python-modules/publicsuffix/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, buildPythonPackage, fetchPypi, isPy3k }:
+
+buildPythonPackage rec {
+  pname = "publicsuffix";
+  version = "1.1.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1adx520249z2cy7ykwjr1k190mn2888wqn9jf8qm27ly4qymjxxf";
+  };
+
+
+  # fix the ASCII-mode LICENSE file read
+  # disable test_fetch and the doctests (which also invoke fetch)
+  patchPhase = stdenv.lib.optionalString isPy3k ''
+    sed -i "s/)\.read(/,encoding='utf-8'\0/" setup.py
+  '' + ''
+    sed -i -e "/def test_fetch/i\\
+    \\t@unittest.skip('requires internet')" -e "/def additional_tests():/,+1d" tests.py
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Allows to get the public suffix of a domain name";
+    homepage = "https://pypi.python.org/pypi/publicsuffix/";
+    license = licenses.mit;
+  };
+}