From 605a373468dcafc0ac4829e2705035efa2583951 Mon Sep 17 00:00:00 2001 From: Elis Hirwing Date: Sat, 10 Mar 2018 08:50:21 +0100 Subject: [PATCH] publicsuffix: move to own file and fix homepage --- .../python-modules/publicsuffix/default.nix | 27 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 26 +----------------- 2 files changed, 28 insertions(+), 25 deletions(-) create mode 100644 pkgs/development/python-modules/publicsuffix/default.nix diff --git a/pkgs/development/python-modules/publicsuffix/default.nix b/pkgs/development/python-modules/publicsuffix/default.nix new file mode 100644 index 000000000000..9c90161c6eaa --- /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; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index aa7417663159..74fa914de1a9 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12718,31 +12718,7 @@ in { ptpython = callPackage ../development/python-modules/ptpython {}; - publicsuffix = buildPythonPackage rec { - name = "publicsuffix-${version}"; - version = "1.1.0"; - - src = pkgs.fetchurl { - url = "mirror://pypi/p/publicsuffix/${name}.tar.gz"; - sha256 = "1adx520249z2cy7ykwjr1k190mn2888wqn9jf8qm27ly4qymjxxf"; - }; - - # fix the ASCII-mode LICENSE file read - # disable test_fetch and the doctests (which also invoke fetch) - patchPhase = 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 = { - description = "Allows to get the public suffix of a domain name"; - homepage = "http://pypi.python.org/pypi/publicsuffix/"; - license = licenses.mit; - }; - }; - + publicsuffix = callPackage ../development/python-modules/publicsuffix {}; py = callPackage ../development/python-modules/py { };