commit
308169a518
34
pkgs/development/python-modules/tld/default.nix
Normal file
34
pkgs/development/python-modules/tld/default.nix
Normal file
@ -0,0 +1,34 @@
|
||||
{ stdenv, fetchPypi, python }:
|
||||
|
||||
python.pkgs.buildPythonPackage rec {
|
||||
pname = "tld";
|
||||
version = "0.9.3";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "0i0prgwrmm157h6fa5bx9wm0m70qq2nhzp743374a94p9s766rpp";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = with python.pkgs; [ six ];
|
||||
checkInputs = with python.pkgs; [ factory_boy faker pytest pytestcov tox ];
|
||||
|
||||
# https://github.com/barseghyanartur/tld/issues/54
|
||||
disabledTests = stdenv.lib.concatMapStringsSep " and " (s: "not " + s) ([
|
||||
"test_1_update_tld_names"
|
||||
"test_1_update_tld_names_command"
|
||||
"test_2_update_tld_names_module"
|
||||
]);
|
||||
|
||||
checkPhase = ''
|
||||
export PATH="$PATH:$out/bin"
|
||||
py.test -k '${disabledTests}'
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = https://github.com/barseghyanartur/tld;
|
||||
description = "Extracts the top level domain (TLD) from the URL given";
|
||||
license = licenses.lgpl21;
|
||||
maintainers = with maintainers; [ genesis ];
|
||||
};
|
||||
|
||||
}
|
@ -1,32 +1,26 @@
|
||||
{ stdenv, pythonPackages, fetchurl, makeWrapper }:
|
||||
{ stdenv, python3Packages, fetchFromGitHub, makeWrapper }:
|
||||
|
||||
with pythonPackages;
|
||||
buildPythonApplication rec {
|
||||
python3Packages.buildPythonApplication rec {
|
||||
pname = "photon";
|
||||
version = "1.0.7";
|
||||
version = "1.3.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/s0md3v/Photon/archive/v${version}.tar.gz";
|
||||
sha256 = "0c5l1sbkkagfxmh8v7yvi6z58mhqbwjyr7fczb5qwxm7la42ah9y";
|
||||
src = fetchFromGitHub {
|
||||
owner = "s0md3v";
|
||||
repo = "Photon";
|
||||
rev = "v${version}";
|
||||
sha256 = "02z1xj72bq35dilr4b6njry4kixz6j2a3ag02nla98q0fvgmgnvy";
|
||||
};
|
||||
|
||||
patches = [ ./destdir.patch ];
|
||||
postPatch = ''
|
||||
substituteInPlace photon.py --replace DESTDIR $out/share/photon
|
||||
'';
|
||||
|
||||
dontBuild = true;
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = [
|
||||
requests
|
||||
urllib3
|
||||
];
|
||||
|
||||
propagatedBuildInputs = with python3Packages; [ requests urllib3 tld ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p "$out"/{bin,share/photon}
|
||||
cp -R photon.py core plugins $out/share/photon
|
||||
|
||||
makeWrapper ${python.interpreter} $out/bin/photon \
|
||||
makeWrapper ${python3Packages.python.interpreter} $out/bin/photon \
|
||||
--set PYTHONPATH "$PYTHONPATH:$out/share/photon" \
|
||||
--add-flags "-O $out/share/photon/photon.py"
|
||||
'';
|
||||
|
@ -5508,6 +5508,8 @@ in {
|
||||
|
||||
textacy = callPackage ../development/python-modules/textacy { };
|
||||
|
||||
tld = callPackage ../development/python-modules/tld { };
|
||||
|
||||
tldextract = callPackage ../development/python-modules/tldextract { };
|
||||
|
||||
pyemd = callPackage ../development/python-modules/pyemd { };
|
||||
|
Loading…
Reference in New Issue
Block a user