1{ stdenv, buildPythonPackage, fetchPypi, isPy3k }:
2
3buildPythonPackage rec {
4 pname = "publicsuffix";
5 version = "1.1.0";
6
7 src = fetchPypi {
8 inherit pname version;
9 sha256 = "1adx520249z2cy7ykwjr1k190mn2888wqn9jf8qm27ly4qymjxxf";
10 };
11
12
13 # fix the ASCII-mode LICENSE file read
14 # disable test_fetch and the doctests (which also invoke fetch)
15 patchPhase = stdenv.lib.optionalString isPy3k ''
16 sed -i "s/)\.read(/,encoding='utf-8'\0/" setup.py
17 '' + ''
18 sed -i -e "/def test_fetch/i\\
19 \\t@unittest.skip('requires internet')" -e "/def additional_tests():/,+1d" tests.py
20 '';
21
22 meta = with stdenv.lib; {
23 description = "Allows to get the public suffix of a domain name";
24 homepage = "https://pypi.python.org/pypi/publicsuffix/";
25 license = licenses.mit;
26 };
27}